浏览代码

[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);
 		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 {
 	inline function substr( pos : Int, ?len : Int ) : String {
 		return untyped HxOverrides.substr(this, pos, len);
 		return untyped HxOverrides.substr(this, pos, len);
 	}
 	}
+	#end
 
 
 	static function fromCharCode( code : Int ) : String;
 	static function fromCharCode( code : Int ) : String;
 }
 }