소스 검색

[js] Added try/catch to HaxeError.init for IE8 compatibility (#9062)

* Added try/catch to HaxeError.init for IE8 compatibility

* Uses .code for more clean output
R32 5 년 전
부모
커밋
8a55005799
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      std/js/Boot.hx

+ 1 - 1
std/js/Boot.hx

@@ -40,7 +40,7 @@ private class HaxeError extends js.lib.Error {
 	}
 
 	static function __init__() {
-		js.lib.Object.defineProperty((cast HaxeError).prototype, "message", {get: () -> (cast String)(js.Lib.nativeThis.val)});
+		js.Syntax.code("try{Object.defineProperty({0}.prototype, \"message\", {get: function(){return String(this.val)}})}catch(e){}", HaxeError);
 	}
 }