Browse Source

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

Dan Korostelev 10 years ago
parent
commit
7f558a8c73
1 changed files with 4 additions and 0 deletions
  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;
 }