UNPKG

openfl

Version:

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

476 lines (459 loc) 11.2 kB
// Class: openfl.utils._Object.Object_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 Reflect() {return require("./../../../Reflect");} function Type() {return require("./../../../Type");} function HxOverrides() {return require("./../../../HxOverrides");} function openfl_display_DisplayObjectContainer() {return require("./../../../openfl/display/DisplayObjectContainer");} function js_Boot() {return require("./../../../js/Boot");} function haxe_lang_Iterable() {return require("./../../../haxe/lang/Iterable");} function Std() {return require("./../../../Std");} // Constructor var Object_Impl_ = function(){} // Meta Object_Impl_.__name__ = "openfl.utils._Object.Object_Impl_"; Object_Impl_.__isInterface__ = false; Object_Impl_.prototype = { }; Object_Impl_.prototype.__class__ = Object_Impl_.prototype.constructor = $hxClasses["openfl.utils._Object.Object_Impl_"] = Object_Impl_; // Init // Statics Object_Impl_._new = function() { var this1 = { }; return this1; } Object_Impl_.hasOwnProperty = function(this1,name) { if(this1 != null) { return (Reflect().default).hasField(this1,name); } else { return false; } } Object_Impl_.isPrototypeOf = function(this1,theClass) { if(this1 != null) { var c = (Type().default).getClass(this1); while(c != null) { if(c == theClass) { return true; } c = (Type().default).getSuperClass(c); } } return false; } Object_Impl_.iterator = function(this1) { if(((this1) instanceof Array)) { var arr = this1; return (HxOverrides().default).iter(arr); } else { var fields = (Reflect().default).fields(this1); if(fields == null) { fields = []; } if(((this1) instanceof (openfl_display_DisplayObjectContainer().default))) { var container = this1; var _g = 0; var _g1 = container.get_numChildren(); while(_g < _g1) { var i = _g++; var child = container.getChildAt(i); var name = child.get_name(); if(name != null && fields.indexOf(name) == -1) { fields.push(name); } } } return (HxOverrides().default).iter(fields); } } Object_Impl_.propertyIsEnumerable = function(this1,name) { if(this1 != null && (Reflect().default).hasField(this1,name)) { return (js_Boot().default).__implements((Reflect().default).field(this1,name),(haxe_lang_Iterable().default)); } else { return false; } } Object_Impl_.toLocaleString = function(this1) { if(this1 == null) { return null; } else { return (Std().default).string(this1); } } Object_Impl_.toString = function(this1) { if(this1 == null) { return null; } else { return (Std().default).string(this1); } } Object_Impl_.valueOf = function(this1) { return this1; } Object_Impl_.__fieldRead = function(this1,name) { return Object_Impl_.__get(this1,name); } Object_Impl_.__fieldWrite = function(this1,name,value) { var this2 = this1; if(this2 != null) { (Reflect().default).setProperty(this2,name,value); } return value; } Object_Impl_.__get = function(this1,key) { if(this1 == null || key == null) { return null; } if((Reflect().default).hasField(this1,key)) { return (Reflect().default).field(this1,key); } else if(((this1) instanceof (openfl_display_DisplayObjectContainer().default))) { var container = this1; var child = container.getChildByName(key); if(child != null) { return child; } } return (Reflect().default).getProperty(this1,key); } Object_Impl_.__set = function(this1,key,value) { if(this1 != null) { (Reflect().default).setProperty(this1,key,value); } return value; } Object_Impl_.__getArray = function(this1,index) { if(this1 == null) { return null; } var arr = (js_Boot().default).__cast(this1 , Array); return arr[index]; } Object_Impl_.__setArray = function(this1,index,value) { if(this1 == null) { return value; } var arr = (js_Boot().default).__cast(this1 , Array); return arr[index] = value; } Object_Impl_.toFunction = function(this1) { return this1; } Object_Impl_.toFloat = function(this1) { if(typeof(this1) == "number") { return this1; } else { return NaN; } } Object_Impl_.toInt = function(this1) { return this1; } Object_Impl_.toBool = function(this1) { if(typeof(this1) == "boolean") { return this1; } else if(typeof(this1) == "number") { return this1 != 0; } else { return this1 != null; } } Object_Impl_.__negate = function(this1) { var float = this1; return -float; } Object_Impl_.__preIncrement = function(this1) { var float = this1; return ++float; } Object_Impl_.__postIncrement = function(this1) { var float = this1; return float++; } Object_Impl_.__preDecrement = function(this1) { var float = this1; return --float; } Object_Impl_.__postDecrement = function(this1) { var float = this1; return float--; } Object_Impl_.__add = function(a,b) { if(typeof(a) == "string" || typeof(b) == "string") { var this1 = a; var this2 = b; return (this1 == null ? null : (Std().default).string(this1)) + (this2 == null ? null : (Std().default).string(this2)); } else { var floatA = a; var floatB = b; return floatA + floatB; } } Object_Impl_.__addString = function(a,b) { var this1 = a; var stringA = this1 == null ? null : (Std().default).string(this1); return stringA + b; } Object_Impl_.__addInt = function(a,b) { var floatA = a; return floatA + b; } Object_Impl_.__addFloat = function(a,b) { var floatA = a; return floatA + b; } Object_Impl_.__sub = function(a,b) { var floatA = a; var floatB = b; return floatA - floatB; } Object_Impl_.__subInt = function(a,b) { var floatA = a; return floatA - b; } Object_Impl_.__intSub = function(a,b) { var floatB = b; return a - floatB; } Object_Impl_.__subFloat = function(a,b) { var floatA = a; return floatA - b; } Object_Impl_.__floatSub = function(a,b) { var floatB = b; return a - floatB; } Object_Impl_.__mul = function(a,b) { var floatA = a; var floatB = b; return floatA * floatB; } Object_Impl_.__mulInt = function(a,b) { var floatA = a; return floatA * b; } Object_Impl_.__mulFloat = function(a,b) { var floatA = a; return floatA * b; } Object_Impl_.__div = function(a,b) { var floatA = a; var floatB = b; return floatA / floatB; } Object_Impl_.__divInt = function(a,b) { var floatA = a; return floatA / b; } Object_Impl_.__intDiv = function(a,b) { var floatB = b; return a / floatB; } Object_Impl_.__divFloat = function(a,b) { var floatA = a; return floatA / b; } Object_Impl_.__floatDiv = function(a,b) { var floatB = b; return a / floatB; } Object_Impl_.__mod = function(a,b) { var floatA = a; var floatB = b; return floatA % floatB; } Object_Impl_.__modInt = function(a,b) { var floatA = a; return floatA % b; } Object_Impl_.__intMod = function(a,b) { var floatB = b; return a % floatB; } Object_Impl_.__modFloat = function(a,b) { var floatA = a; return floatA % b; } Object_Impl_.__floatMod = function(a,b) { var floatB = b; return a % floatB; } Object_Impl_.__eq = function(a,b) { var dynamicA = a; var dynamicB = b; return dynamicA == dynamicB; } Object_Impl_.__eqDynamic = function(a,b) { var dynamicA = a; return dynamicA == b; } Object_Impl_.__neq = function(a,b) { var dynamicA = a; var dynamicB = b; return dynamicA != dynamicB; } Object_Impl_.__neqDynamic = function(a,b) { var dynamicA = a; return dynamicA != b; } Object_Impl_.__lt = function(a,b) { var floatA = a; var floatB = b; return floatA < floatB; } Object_Impl_.__ltInt = function(a,b) { var floatA = a; return floatA < b; } Object_Impl_.__intLt = function(a,b) { var floatB = b; return a < floatB; } Object_Impl_.__ltFloat = function(a,b) { var floatA = a; return floatA < b; } Object_Impl_.__floatLt = function(a,b) { var floatB = b; return a < floatB; } Object_Impl_.__lte = function(a,b) { var floatA = a; var floatB = b; return floatA <= floatB; } Object_Impl_.__lteInt = function(a,b) { var floatB = b; return Object_Impl_.__lte(a,floatB); } Object_Impl_.__intLte = function(a,b) { var floatA = a; return Object_Impl_.__lte(floatA,b); } Object_Impl_.__lteFloat = function(a,b) { var floatB = b; return Object_Impl_.__lte(a,floatB); } Object_Impl_.__floatLte = function(a,b) { var floatA = a; return Object_Impl_.__lte(floatA,b); } Object_Impl_.__gt = function(a,b) { var floatA = a; var floatB = b; return floatA > floatB; } Object_Impl_.__gtInt = function(a,b) { var floatB = b; return Object_Impl_.__gt(a,floatB); } Object_Impl_.__intGt = function(a,b) { var floatB = b; return a > floatB; } Object_Impl_.__gtFloat = function(a,b) { var floatB = b; return Object_Impl_.__gt(a,floatB); } Object_Impl_.__floatGt = function(a,b) { var floatB = b; return a > floatB; } Object_Impl_.__gte = function(a,b) { var floatA = a; var floatB = b; return floatA >= floatB; } Object_Impl_.__gteInt = function(a,b) { var floatB = b; return Object_Impl_.__gte(a,floatB); } Object_Impl_.__intGte = function(a,b) { var floatB = b; return a >= floatB; } Object_Impl_.__gteFloat = function(a,b) { var floatB = b; return Object_Impl_.__gte(a,floatB); } Object_Impl_.__floatGte = function(a,b) { var floatB = b; return a >= floatB; } Object_Impl_.__complement = function(this1) { var int = this1; return ~int; } Object_Impl_.__and = function(a,b) { var intA = a; var intB = b; return intA & intB; } Object_Impl_.__andInt = function(a,b) { var intA = a; return intA & b; } Object_Impl_.__or = function(a,b) { var intA = a; var intB = b; return intA | intB; } Object_Impl_.__orInt = function(a,b) { var intA = a; return intA | b; } Object_Impl_.__xor = function(a,b) { var intA = a; var intB = b; return intA ^ intB; } Object_Impl_.__xorInt = function(a,b) { var intA = a; return intA ^ b; } Object_Impl_.__shr = function(a,b) { var intA = a; var intB = b; return intA >> intB; } Object_Impl_.__shrInt = function(a,b) { var intA = a; return intA >> b; } Object_Impl_.__intShr = function(a,b) { var intB = b; return a >> intB; } Object_Impl_.__ushr = function(a,b) { var intA = a; var intB = b; return intA >>> intB; } Object_Impl_.__ushrInt = function(a,b) { var intA = a; return intA >>> b; } Object_Impl_.__intUshr = function(a,b) { var intB = b; return a >>> intB; } Object_Impl_.__shl = function(a,b) { var intA = a; var intB = b; return intA << intB; } Object_Impl_.__shlInt = function(a,b) { var intA = a; return intA << b; } Object_Impl_.__intShl = function(a,b) { var intB = b; return a << intB; } Object_Impl_.__meta__ = { statics : { iterator : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __get : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __set : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __getArray : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __setArray : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}} // Export exports.default = Object_Impl_;