]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/mozilla/ecma_2/RegExp/properties-001.js
JavaScriptCore-576.tar.gz
[apple/javascriptcore.git] / tests / mozilla / ecma_2 / RegExp / properties-001.js
index 16f265c352be90f252f86160e3c03c2e5f456d5a..3eb51cbcdfdfa77ceff6d2ac2454a678c2063b63 100644 (file)
@@ -56,8 +56,15 @@ function AddRegExpCases( re, s, g, i, m, l ) {
                  s,
                  re.source );
 
+/*
+ * http://bugzilla.mozilla.org/show_bug.cgi?id=225550 changed
+ * the behavior of toString() and toSource() on empty regexps.
+ * So branch if |s| is the empty string -
+ */
+    var S = s? s : '(?:)';
+
     AddTestCase( re + ".toString()",
-                 "/" + s +"/" + (g?"g":"") + (i?"i":"") +(m?"m":""),
+                 "/" + S +"/" + (g?"g":"") + (i?"i":"") +(m?"m":""),
                  re.toString() );
 
     AddTestCase( re + ".global",