Parcourir la source

Fix String.substr (pos != 0, length < 0)

Pascal Peridont il y a 19 ans
Parent
commit
1c90918d12
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      std/js/Boot.hx

+ 1 - 0
std/js/Boot.hx

@@ -218,6 +218,7 @@ class Boot {
 			};
 			var oldsub = String.prototype.substr;
 			String.prototype.substr = function(pos,len){
+				if( pos != null && pos != 0 && len < 0 ) return "";
 				if( pos < 0 ){
 					pos = this.length + pos;
 					if( pos < 0 ) pos = 0;