|
@@ -45,23 +45,21 @@ class Boot {
|
|
}
|
|
}
|
|
|
|
|
|
private static function __trace(v,i : haxe.PosInfos) {
|
|
private static function __trace(v,i : haxe.PosInfos) {
|
|
- untyped {
|
|
|
|
- var msg = if( i != null ) i.fileName+":"+i.lineNumber+": " else "";
|
|
|
|
- #if jsfl
|
|
|
|
- msg += __string_rec(v,"");
|
|
|
|
- fl.trace(msg);
|
|
|
|
- #else
|
|
|
|
- msg += __string_rec(v, "");
|
|
|
|
- if( i != null && i.customParams != null )
|
|
|
|
- for( v in i.customParams )
|
|
|
|
- msg += "," + __string_rec(v, "");
|
|
|
|
- var d;
|
|
|
|
- if( __js__("typeof")(document) != "undefined" && (d = document.getElementById("haxe:trace")) != null )
|
|
|
|
- d.innerHTML += __unhtml(msg)+"<br/>";
|
|
|
|
- else if( __js__("typeof console") != "undefined" && __js__("console").log != null )
|
|
|
|
- __js__("console").log(msg);
|
|
|
|
- #end
|
|
|
|
- }
|
|
|
|
|
|
+ var msg = if (i != null) i.fileName + ":" + i.lineNumber + ": " else "";
|
|
|
|
+ #if jsfl
|
|
|
|
+ msg += __string_rec(v,"");
|
|
|
|
+ (untyped fl).trace(msg);
|
|
|
|
+ #else
|
|
|
|
+ msg += __string_rec(v, "");
|
|
|
|
+ if (i != null && i.customParams != null)
|
|
|
|
+ for (v in i.customParams)
|
|
|
|
+ msg += "," + __string_rec(v, "");
|
|
|
|
+ var d;
|
|
|
|
+ if( js.Lib.typeof(untyped document) != "undefined" && (d = (untyped document).getElementById("haxe:trace")) != null )
|
|
|
|
+ d.innerHTML += __unhtml(msg)+"<br/>";
|
|
|
|
+ else if( js.Lib.typeof(untyped console) != "undefined" && (untyped console).log != null )
|
|
|
|
+ (untyped console).log(msg);
|
|
|
|
+ #end
|
|
}
|
|
}
|
|
|
|
|
|
private static function __clear_trace() {
|
|
private static function __clear_trace() {
|
|
@@ -105,7 +103,7 @@ class Boot {
|
|
return "null";
|
|
return "null";
|
|
if( s.length >= 5 )
|
|
if( s.length >= 5 )
|
|
return "<...>"; // too much deep recursion
|
|
return "<...>"; // too much deep recursion
|
|
- var t = __js__("typeof(o)");
|
|
|
|
|
|
+ var t = js.Lib.typeof(o);
|
|
if( t == "function" && (isClass(o) || isEnum(o)) )
|
|
if( t == "function" && (isClass(o) || isEnum(o)) )
|
|
t = "object";
|
|
t = "object";
|
|
switch( t ) {
|
|
switch( t ) {
|
|
@@ -191,13 +189,13 @@ class Boot {
|
|
return false;
|
|
return false;
|
|
switch( cl ) {
|
|
switch( cl ) {
|
|
case Int:
|
|
case Int:
|
|
- return (untyped __js__("typeof"))(o) == "number" && untyped __js__("(o|0) === o");
|
|
|
|
|
|
+ return js.Lib.typeof(o) == "number" && untyped __js__("(o|0) === o");
|
|
case Float:
|
|
case Float:
|
|
- return (untyped __js__("typeof"))(o) == "number";
|
|
|
|
|
|
+ return js.Lib.typeof(o) == "number";
|
|
case Bool:
|
|
case Bool:
|
|
- return (untyped __js__("typeof"))(o) == "boolean";
|
|
|
|
|
|
+ return js.Lib.typeof(o) == "boolean";
|
|
case String:
|
|
case String:
|
|
- return (untyped __js__("typeof"))(o) == "string";
|
|
|
|
|
|
+ return js.Lib.typeof(o) == "string";
|
|
case Array:
|
|
case Array:
|
|
return (untyped __js__("(o instanceof Array)")) && o.__enum__ == null;
|
|
return (untyped __js__("(o instanceof Array)")) && o.__enum__ == null;
|
|
case Dynamic:
|
|
case Dynamic:
|
|
@@ -205,13 +203,13 @@ class Boot {
|
|
default:
|
|
default:
|
|
if( o != null ) {
|
|
if( o != null ) {
|
|
// Check if o is an instance of a Haxe class or a native JS object
|
|
// Check if o is an instance of a Haxe class or a native JS object
|
|
- if( (untyped __js__("typeof"))(cl) == "function" ) {
|
|
|
|
|
|
+ if( js.Lib.typeof(cl) == "function" ) {
|
|
if( untyped __js__("o instanceof cl") )
|
|
if( untyped __js__("o instanceof cl") )
|
|
return true;
|
|
return true;
|
|
if( __interfLoop(getClass(o),cl) )
|
|
if( __interfLoop(getClass(o),cl) )
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
- else if ( (untyped __js__("typeof"))(cl) == "object" && __isNativeObj(cl) ) {
|
|
|
|
|
|
+ else if ( js.Lib.typeof(cl) == "object" && __isNativeObj(cl) ) {
|
|
if( untyped __js__("o instanceof cl") )
|
|
if( untyped __js__("o instanceof cl") )
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|