[Webkit-unassigned] [Bug 16752] New: back-references to non-existent selectors should raise (acid3 bug)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jan 5 14:23:24 PST 2008


http://bugs.webkit.org/show_bug.cgi?id=16752

           Summary: back-references to non-existent selectors should raise
                    (acid3 bug)
           Product: WebKit
           Version: 525+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: eric at webkit.org
                CC: darin at apple.com


back-references to non-existent selectors should raise (acid3 bug)

    function () {
      // test 86: Regular Expressions
      var ok = true;
      try {
        eval("/TA[])]/.exec('TA]')");
        // JS regexps aren't like Perl regexps, if their character
        // classes start with a ] that means they're empty. So this
        // is a syntax error; if we get here it's a bug.
        ok = false;
      } catch (e) { }
      assert(ok, "orphaned bracket not considered parse error in regular
expression literal");
      try {
        if (eval("/[]/.exec('')"))
          ok = false;
      } catch (e) {
        ok = false;
      }
      assert(ok, "/[]/ either failed to parse or matched something");
      var x = /(\3)(\1)(a)/.exec('cat'); // the \3 matches the empty string,
qv. ES3:15.10.2.9
      assert(x, "/(\\3)(\\1)(a)/ failed to match 'cat'");
      assert(x.length == 4, "/(\\3)(\\1)(a)/ failed to return four
components");
      assert(x[0] == "a", "/(\\3)(\\1)(a)/ failed to find 'a' in 'cat'");
      assert(x[1] == "", "/(\\3)(\\1)(a)/ failed to find '' in 'cat' as first
part");
      assert(x[2] == "", "/(\\3)(\\1)(a)/ failed to find '' in 'cat' as second
part");
      assert(x[3] == "a", "/(\\3)(\\1)(a)/ failed to find 'a' in 'cat' as third
part");
      try {
        eval("/(1)(2)(3)\6(4)(5)/");
        ok = false;
      } catch (e) { }
      assert(ok, "should have raised syntax error for a backreference to a
non-existent capture");
      try {
        eval("/(1)\0(2)/");
        ok = false;
      } catch (e) { }
      assert(ok, "should have raised syntax error for a backreference to the
zeroth capture");
      return 6;
    },


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list