Ignore:
Timestamp:
Jan 16, 2011, 5:52:16 PM (14 years ago)
Author:
[email protected]
Message:

2011-01-16 Oliver Hunt <[email protected]>

Reviewed by Sam Weinig.

[jsfunfuzz] Parser doesn't correctly validate for-loop syntax
https://bugs.webkit.org/show_bug.cgi?id=52516

Add test for the case where a syntax error immediately follows
multiple declarations in a for-loop initialiser.

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

2011-01-16 Oliver Hunt <[email protected]>

Reviewed by Sam Weinig.

[jsfunfuzz] Parser doesn't correctly validate for-loop syntax
https://bugs.webkit.org/show_bug.cgi?id=52516

Ensure that we always check for a semicolon after encountering
multiple declarations in the initialiser portion of a for-loop.

  • parser/JSParser.cpp: (JSC::JSParser::parseForStatement):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/JSParser.cpp

    r75896 r75899  
    796796
    797797        // Remainder of a standard for loop is handled identically
    798         if (declarations > 1 || match(SEMICOLON))
     798        if (match(SEMICOLON))
    799799            goto standardForLoop;
     800
     801        failIfFalse(declarations == 1);
    800802
    801803        // Handle for-in with var declaration
Note: See TracChangeset for help on using the changeset viewer.