Explorar o código

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

Dan Korostelev %!s(int64=10) %!d(string=hai) anos
pai
achega
7f558a8c73
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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;
 }