Nicolas Cannasse 18 years ago
parent
commit
b3f11bd5c7
2 changed files with 7 additions and 7 deletions
  1. 2 0
      doc/CHANGES.txt
  2. 5 7
      std/EReg.hx

+ 2 - 0
doc/CHANGES.txt

@@ -9,6 +9,8 @@
 	allowed 'u' utf8 for regexp (needs Neko 1.6.1 regexp.ndll on windows)
 	allowed 'u' utf8 for regexp (needs Neko 1.6.1 regexp.ndll on windows)
 	onclick and onsubmit JS events returns Bool
 	onclick and onsubmit JS events returns Bool
 	fixed inherited constructor of extern class was always private
 	fixed inherited constructor of extern class was always private
+	fixed Ereg.split without 'g' flag on JS/Flash9
+	fixed haxe.Stack in JS without -debug
 
 
 2007-08-29: 1.15
 2007-08-29: 1.15
 	fixed bug with Enum.construct when Enum have type parameters
 	fixed bug with Enum.construct when Enum have type parameters

+ 5 - 7
std/EReg.hx

@@ -210,10 +210,10 @@ class EReg {
 		} while( global );
 		} while( global );
 		a.push(s.substr(pos,len));
 		a.push(s.substr(pos,len));
 		return a;
 		return a;
-		#else js
-		return untyped s.split(r);
-		#else flash9
-		return untyped s.split(r);
+		#else (js || flash9)
+		// we can't use directly s.split because it's ignoring the 'g' flag
+		var d = "#__delim__#";
+		return untyped s.replace(r,d).split(d);		
 		#else flash
 		#else flash
 		throw "EReg::split not implemented";
 		throw "EReg::split not implemented";
 		return null;
 		return null;
@@ -276,9 +276,7 @@ class EReg {
 		} while( global );
 		} while( global );
 		b.addSub(s,pos,len);
 		b.addSub(s,pos,len);
 		return b.toString();
 		return b.toString();
-		#else js
-		return untyped s.replace(r,by);
-		#else flash9
+		#else (js || flash9)
 		return untyped s.replace(r,by);
 		return untyped s.replace(r,by);
 		#else flash
 		#else flash
 		throw "EReg::replace not implemented";
 		throw "EReg::replace not implemented";