UNPKG

starling-framework

Version:

A fast, productive library for 2D cross-platform development.

111 lines (93 loc) 3.39 kB
// Class: haxe.xml._Access.Access_Impl_ var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this $global.Object.defineProperty(exports, "__esModule", {value: true}); var __map_reserved = {}; // Imports var $hxClasses = require("./../../../hxClasses_stub").default; var $hxEnums = require("./../../../hxEnums_stub").default; var $import = require("./../../../import_stub").default; function Xml() {return require("./../../../Xml");} function js__$Boot_HaxeError() {return require("./../../../js/_Boot/HaxeError");} function _$Xml_XmlType_$Impl_$() {return require("./../../../_Xml/XmlType_Impl_");} function StringTools() {return require("./../../../StringTools");} function StringBuf() {return require("./../../../StringBuf");} // Constructor var Access_Impl_ = function(){} // Meta Access_Impl_.__name__ = "haxe.xml._Access.Access_Impl_"; Access_Impl_.__isInterface__ = false; Access_Impl_.prototype = { }; Access_Impl_.prototype.__class__ = Access_Impl_.prototype.constructor = $hxClasses["haxe.xml._Access.Access_Impl_"] = Access_Impl_; // Init // Statics Access_Impl_.get_x = function(this1) { return this1; } Access_Impl_.get_name = function(this1) { if(this1.nodeType == (Xml().default).Document) { return "Document"; } else { return this1.get_nodeName(); } } Access_Impl_.get_node = function(this1) { return this1; } Access_Impl_.get_nodes = function(this1) { return this1; } Access_Impl_.get_att = function(this1) { return this1; } Access_Impl_.get_has = function(this1) { return this1; } Access_Impl_.get_hasNode = function(this1) { return this1; } Access_Impl_.get_elements = function(this1) { return this1.elements(); } Access_Impl_._new = function(x) { if(x.nodeType != (Xml().default).Document && x.nodeType != (Xml().default).Element) { throw new (js__$Boot_HaxeError().default)("Invalid nodeType " + (_$Xml_XmlType_$Impl_$().default).toString(x.nodeType)); } var this1 = x; return this1; } Access_Impl_.get_innerData = function(this1) { var it = this1.iterator(); if(!it.hasNext()) { throw new (js__$Boot_HaxeError().default)((this1.nodeType == (Xml().default).Document ? "Document" : this1.get_nodeName()) + " does not have data"); } var v = it.next(); if(it.hasNext()) { var n = it.next(); if(v.nodeType == (Xml().default).PCData && n.nodeType == (Xml().default).CData && (StringTools().default).trim(v.get_nodeValue()) == "") { if(!it.hasNext()) { return n.get_nodeValue(); } var n2 = it.next(); if(n2.nodeType == (Xml().default).PCData && (StringTools().default).trim(n2.get_nodeValue()) == "" && !it.hasNext()) { return n.get_nodeValue(); } } throw new (js__$Boot_HaxeError().default)((this1.nodeType == (Xml().default).Document ? "Document" : this1.get_nodeName()) + " does not only have data"); } if(v.nodeType != (Xml().default).PCData && v.nodeType != (Xml().default).CData) { throw new (js__$Boot_HaxeError().default)((this1.nodeType == (Xml().default).Document ? "Document" : this1.get_nodeName()) + " does not have data"); } return v.get_nodeValue(); } Access_Impl_.get_innerHTML = function(this1) { var s = new (StringBuf().default)(); var x = this1.iterator(); while(x.hasNext()) { var x1 = x.next(); s.add(x1.toString()); } return s.toString(); } // Export exports.default = Access_Impl_;