Ver Fonte

temp compatibility fix: make EReg.customReplace apply global = true by default (was previous behavior)

Simon Krajewski há 12 anos atrás
pai
commit
596a638fd0
5 ficheiros alterados com 20 adições e 5 exclusões
  1. 4 1
      std/cpp/_std/EReg.hx
  2. 4 1
      std/flash/_std/EReg.hx
  3. 4 1
      std/js/_std/EReg.hx
  4. 4 1
      std/neko/_std/EReg.hx
  5. 4 1
      std/php/_std/EReg.hx

+ 4 - 1
std/cpp/_std/EReg.hx

@@ -167,6 +167,9 @@
 	static var regexp_matched_pos : Dynamic -> Int -> { pos : Int, len : Int } = cpp.Lib.load("regexp","regexp_matched_pos",2);
 
 	#if !haxe3
-	public inline function customReplace( s : String, f : EReg -> String ) : String return map(s, f)
+	public inline function customReplace( s : String, f : EReg -> String ) : String {
+		global = true;
+		return map(s, f);
+	}
 	#end	
 }

+ 4 - 1
std/flash/_std/EReg.hx

@@ -91,6 +91,9 @@
 	}
 
 	#if !haxe3
-	public inline function customReplace( s : String, f : EReg -> String ) : String return map(s, f)
+	public inline function customReplace( s : String, f : EReg -> String ) : String {
+		r.global = true;
+		return map(s, f);
+	}
 	#end	
 }

+ 4 - 1
std/js/_std/EReg.hx

@@ -91,6 +91,9 @@
 	}
 
 	#if !haxe3
-	public inline function customReplace( s : String, f : EReg -> String ) : String return map(s, f)
+	public inline function customReplace( s : String, f : EReg -> String ) : String {
+		r.global = true;
+		return map(s, f);
+	}
 	#end	
 }

+ 4 - 1
std/neko/_std/EReg.hx

@@ -178,6 +178,9 @@
 	static var regexp_matched_pos : Dynamic -> Int -> { pos : Int, len : Int } = neko.Lib.load("regexp","regexp_matched_pos",2);
 
 	#if !haxe3
-	public inline function customReplace( s : String, f : EReg -> String ) : String return map(s, f)
+	public inline function customReplace( s : String, f : EReg -> String ) : String {
+		global = true;
+		return map(s, f);
+	}
 	#end	
 }

+ 4 - 1
std/php/_std/EReg.hx

@@ -111,6 +111,9 @@
 	}
 	
 	#if !haxe3
-	public inline function customReplace( s : String, f : EReg -> String ) : String return map(s, f)
+	public inline function customReplace( s : String, f : EReg -> String ) : String {
+		global = true;
+		return map(s, f);
+	}
 	#end
 }