فهرست منبع

[js] move js.Boot.__toStr magic function initialization up (closes #7783)

since it can be already used from normal static inits, dynamically,
like it's done in #7783, it needs to be initialized earlier
Dan Korostelev 6 سال پیش
والد
کامیت
06ee46655c
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      std/js/Boot.hx

+ 5 - 1
std/js/Boot.hx

@@ -219,7 +219,11 @@ class Boot {
 		else throw "Cannot cast " +Std.string(o) + " to " +Std.string(t);
 	}
 
-	static var __toStr = untyped ({}).toString;
+	static var __toStr:js.Function;
+	static function __init__() {
+		Boot.__toStr = (cast {}).toString;
+	}
+
 	// get native JS [[Class]]
 	static function __nativeClassName(o:Dynamic):String {
 		var name = untyped __toStr.call(o).slice(8, -1);