openfl
Version:
A fast, productive library for 2D cross-platform development.
86 lines (69 loc) • 2.55 kB
JavaScript
// Class: openfl.utils.Namespace
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 js_Boot() {return require("./../../js/Boot");}
function openfl_utils_QName() {return require("./../../openfl/utils/QName");}
function Std() {return require("./../../Std");}
function openfl_Lib() {return require("./../../openfl/Lib");}
// Constructor
var Namespace = function(prefixValue,uriValue) {
if(prefixValue == null && uriValue == null) {
this.__prefix = "";
this.__uri = "";
} else if(prefixValue != null && uriValue == null) {
if(((prefixValue) instanceof Namespace)) {
var ns = (js_Boot().default).__cast(prefixValue , Namespace);
this.__prefix = ns.get_prefix();
this.__uri = ns.get_uri();
} else if(((prefixValue) instanceof (openfl_utils_QName().default))) {
var qname = (js_Boot().default).__cast(prefixValue , (openfl_utils_QName().default));
this.__prefix = null;
this.__uri = qname.get_uri();
} else {
this.__prefix = null;
this.__uri = (Std().default).string(prefixValue);
}
} else {
if(prefixValue == null) {
this.__prefix = null;
} else {
this.__prefix = (Std().default).string(prefixValue);
if(this.__prefix.length > 0 && !(openfl_Lib().default).isXMLName(this.__prefix)) {
this.__prefix = null;
}
}
if(((uriValue) instanceof (openfl_utils_QName().default))) {
var qname1 = (js_Boot().default).__cast(uriValue , (openfl_utils_QName().default));
this.__uri = qname1.get_uri();
} else {
this.__uri = (Std().default).string(uriValue);
}
}
}
// Meta
Namespace.__name__ = "openfl.utils.Namespace";
Namespace.__isInterface__ = false;
Namespace.prototype = {
get_uri: function() {
return this.__uri;
},
get_prefix: function() {
return this.__prefix;
}
};
Namespace.prototype.__class__ = Namespace.prototype.constructor = $hxClasses["openfl.utils.Namespace"] = Namespace;
// Init
{
var tmp = (openfl_utils_QName().default).prototype;
var tmp1 = { get : function () { return this.get_uri (); }};
var tmp2 = function () { return this.get_prefix (); }
global.Object.defineProperties(tmp,{ uri : tmp1, prefix : { get : tmp2}});
};
// Statics
// Export
exports.default = Namespace;