瀏覽代碼

Remove String.fromCodePoint polyfill for es6 (#11713)

RblSb 1 年之前
父節點
當前提交
5bb151ae18
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      std/js/_std/String.hx

+ 2 - 0
std/js/_std/String.hx

@@ -44,8 +44,10 @@
 		return untyped __define_feature__('String.fromCharCode', js.Syntax.code("String.fromCodePoint({0})", code));
 	}
 
+	#if (js_es <= 5)
 	static function __init__():Void {
 		untyped __feature__('String.fromCharCode',
 			js.Syntax.code("if( String.fromCodePoint == null ) String.fromCodePoint = function(c) { return c < 0x10000 ? String.fromCharCode(c) : String.fromCharCode((c>>10)+0xD7C0)+String.fromCharCode((c&0x3FF)+0xDC00); }"));
 	}
+	#end
 }