소스 검색

[js] use native String.substr when -D js-es5

Dan Korostelev 10 년 전
부모
커밋
7f558a8c73
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      std/js/_std/String.hx

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

@@ -36,9 +36,13 @@
 		return untyped HxOverrides.cca(this, index);
 	}
 
+	#if js_es5
+	function substr( pos : Int, ?len : Int ) : String;
+	#else
 	inline function substr( pos : Int, ?len : Int ) : String {
 		return untyped HxOverrides.substr(this, pos, len);
 	}
+	#end
 
 	static function fromCharCode( code : Int ) : String;
 }