Kaynağa Gözat

guard against failing IE8 tests (closes #2575)

Simon Krajewski 11 yıl önce
ebeveyn
işleme
ab8778bf56
2 değiştirilmiş dosya ile 5 ekleme ve 2 silme
  1. 3 0
      tests/unit/TestDCE.hx
  2. 2 2
      tests/unit/TestEReg.hx

+ 3 - 0
tests/unit/TestDCE.hx

@@ -154,6 +154,9 @@ class TestDCE extends Test {
 		try {
 			throw c;
 		} catch (_:Dynamic) { }
+		#if js
+		if (!js.Browser.supported || js.Browser.navigator.userAgent.indexOf('MSIE 8') == -1)
+		#end
 		hf(ThrownWithToString, "toString");
 	}
 }

+ 2 - 2
tests/unit/TestEReg.hx

@@ -21,7 +21,7 @@ class TestEReg extends Test {
 		eq( r.matched(0), "aaa" );
 		eq( r.matchedLeft(), "" );
 		eq( r.matchedRight(), "" );
-		eq( r.matched(1), null ); // JS/IE7-8 bug
+		t(r.matched(1) == null #if js || (js.Browser.supported && js.Browser.navigator.userAgent.indexOf('MSIE 8') > -1) #end); // JS/IE7-8 bug
 		eq( r.matched(2), "" );
 		unspec(function() r.matched(3));
 		unspec(function() r.matched(-1));
@@ -29,7 +29,7 @@ class TestEReg extends Test {
 		var r = ~/^(b)?$/;
 		t( r.match("") );
 		eq( r.matched(0), "" );
-		eq( r.matched(1), null ); // JS/IE7-8 bug
+		t(r.matched(1) == null #if js || (js.Browser.supported && js.Browser.navigator.userAgent.indexOf('MSIE 8') > -1) #end); // JS/IE7-8 bug
 		
 		t( ~/\//.match("/") );