소스 검색

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

Pascal Peridont 19 년 전
부모
커밋
1c90918d12
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  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;