Changeset 88974 in webkit


Ignore:
Timestamp:
Jun 15, 2011 2:46:13 PM (13 years ago)
Author:
oliver@apple.com
Message:

2011-06-15 Oliver Hunt <oliver@apple.com>

Reviewed by Darin Adler.

REGRESSION (r88719): 5by5.tv schedule is not visible
https://bugs.webkit.org/show_bug.cgi?id=62720

Add test for the "interesting" ascii characters that may occur in an identifier

  • fast/js/parser-syntax-check-expected.txt:
  • fast/js/script-tests/parser-syntax-check.js:

2011-06-15 Oliver Hunt <oliver@apple.com>

Reviewed by Darin Adler.

REGRESSION (r88719): 5by5.tv schedule is not visible
https://bugs.webkit.org/show_bug.cgi?id=62720

Problem here is that the lexer wasn't considering '$' to be
a valid character in an identifier.

  • parser/Lexer.h: (JSC::Lexer::lexExpectIdentifier):
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r88972 r88974  
     12011-06-15  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        REGRESSION (r88719): 5by5.tv schedule is not visible
     6        https://bugs.webkit.org/show_bug.cgi?id=62720
     7
     8        Add test for the "interesting" ascii characters that may occur in an identifier
     9
     10        * fast/js/parser-syntax-check-expected.txt:
     11        * fast/js/script-tests/parser-syntax-check.js:
     12
    1132011-06-15  Stephen White  <senorblanco@chromium.org>
    214
  • trunk/LayoutTests/fast/js/parser-syntax-check-expected.txt

    r76148 r88974  
    550550PASS Invalid: "'use strict'; (function __proto__(){})"
    551551PASS Invalid: "function f() { 'use strict'; (function __proto__(){}) }"
     552PASS Valid:   "if (0) $foo; "
     553PASS Valid:   "function f() { if (0) $foo;  }"
     554PASS Valid:   "if (0) _foo; "
     555PASS Valid:   "function f() { if (0) _foo;  }"
     556PASS Valid:   "if (0) foo$; "
     557PASS Valid:   "function f() { if (0) foo$;  }"
     558PASS Valid:   "if (0) foo_; "
     559PASS Valid:   "function f() { if (0) foo_;  }"
     560PASS Valid:   "if (0) obj.$foo; "
     561PASS Valid:   "function f() { if (0) obj.$foo;  }"
     562PASS Valid:   "if (0) obj._foo; "
     563PASS Valid:   "function f() { if (0) obj._foo;  }"
     564PASS Valid:   "if (0) obj.foo$; "
     565PASS Valid:   "function f() { if (0) obj.foo$;  }"
     566PASS Valid:   "if (0) obj.foo_; "
     567PASS Valid:   "function f() { if (0) obj.foo_;  }"
     568PASS Valid:   "if (0) obj.foo\u03bb; "
     569PASS Valid:   "function f() { if (0) obj.foo\u03bb;  }"
    552570PASS successfullyParsed is true
    553571
  • trunk/LayoutTests/fast/js/script-tests/parser-syntax-check.js

    r76148 r88974  
    352352invalid("'use strict'; (function __proto__(){})")
    353353
     354valid("if (0) $foo; ")
     355valid("if (0) _foo; ")
     356valid("if (0) foo$; ")
     357valid("if (0) foo_; ")
     358valid("if (0) obj.$foo; ")
     359valid("if (0) obj._foo; ")
     360valid("if (0) obj.foo$; ")
     361valid("if (0) obj.foo_; ")
     362valid("if (0) obj.foo\\u03bb; ")
     363
    354364var successfullyParsed = true;
  • trunk/Source/JavaScriptCore/ChangeLog

    r88962 r88974  
     12011-06-15  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        REGRESSION (r88719): 5by5.tv schedule is not visible
     6        https://bugs.webkit.org/show_bug.cgi?id=62720
     7
     8        Problem here is that the lexer wasn't considering '$' to be
     9        a valid character in an identifier.
     10
     11        * parser/Lexer.h:
     12        (JSC::Lexer::lexExpectIdentifier):
     13
    1142011-06-15  Oliver Hunt  <oliver@apple.com>
    215
  • trunk/Source/JavaScriptCore/parser/Lexer.h

    r88724 r88974  
    203203        // Here's the shift
    204204        if (ptr < end) {
    205             if (!WTF::isASCII(*ptr) || (*ptr == '\\') || (*ptr == '_'))
     205            if ((!WTF::isASCII(*ptr)) || (*ptr == '\\') || (*ptr == '_') || (*ptr == '$'))
    206206                goto slowCase;
    207207            m_current = *ptr;
Note: See TracChangeset for help on using the changeset viewer.