Browse Source

removed usage of static RegExp vars (fixed issue #541)

Nicolas Cannasse 14 years ago
parent
commit
7d272b630d
1 changed files with 3 additions and 9 deletions
  1. 3 9
      std/js/_std/EReg.hx

+ 3 - 9
std/js/_std/EReg.hx

@@ -35,8 +35,6 @@
 	public function match( s : String ) : Bool {
 	public function match( s : String ) : Bool {
 		r.m = r.exec(s);
 		r.m = r.exec(s);
 		r.s = s;
 		r.s = s;
-		r.l = untyped __js__("RegExp.leftContext");
-		r.r = untyped __js__("RegExp.rightContext");
 		return (r.m != null);
 		return (r.m != null);
 	}
 	}
 
 
@@ -46,17 +44,13 @@
 
 
 	public function matchedLeft() : String {
 	public function matchedLeft() : String {
 		if( r.m == null ) throw "No string matched";
 		if( r.m == null ) throw "No string matched";
-		if( r.l == null ) return r.s.substr(0,r.m.index);
-		return r.l;
+		return r.s.substr(0,r.m.index);
 	}
 	}
 
 
 	public function matchedRight() : String {
 	public function matchedRight() : String {
 		if( r.m == null ) throw "No string matched";
 		if( r.m == null ) throw "No string matched";
-		if( r.r == null ) {
-			var sz = r.m.index+r.m[0].length;
-			return r.s.substr(sz,r.s.length-sz);
-		}
-		return r.r;
+		var sz = r.m.index+r.m[0].length;
+		return r.s.substr(sz,r.s.length-sz);
 	}
 	}
 
 
 	public function matchedPos() : { pos : Int, len : Int } {
 	public function matchedPos() : { pos : Int, len : Int } {