Changeset 69963 in webkit
- Timestamp:
- Oct 18, 2010 9:30:12 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r69957 r69963 1 2010-10-18 Zoltan Herczeg <zherczeg@webkit.org> 2 3 Reviewed by Oliver Hunt. 4 5 if (0) throw "x" ; else { } throws parse error after r69906 6 https://bugs.webkit.org/show_bug.cgi?id=47807 7 8 r69906 introduced a bug: the semicolon is not parsed after a throw 9 expression anymore. Thus, the semicolon terminates the "if" parsing 10 in the example above, and the else token results a parse error. 11 12 * parser/JSParser.cpp: 13 (JSC::JSParser::parseThrowStatement): 14 1 15 2010-10-18 Peter Varga <pvarga@inf.u-szeged.hu> 2 16 -
trunk/JavaScriptCore/parser/JSParser.cpp
r69941 r69963 901 901 int eEnd = lastTokenEnd(); 902 902 int endLine = tokenLine(); 903 failIfFalse(autoSemiColon()); 903 904 904 905 return context.createThrowStatement(expr, eStart, eEnd, startLine, endLine); -
trunk/LayoutTests/ChangeLog
r69958 r69963 1 2010-10-18 Zoltan Herczeg <zherczeg@webkit.org> 2 3 Reviewed by Oliver Hunt. 4 5 if (0) throw "x" ; else { } throws parse error after r69906 6 https://bugs.webkit.org/show_bug.cgi?id=47807 7 8 Adding a new test case to break-ASI.js 9 10 * fast/js/break-ASI-expected.txt: 11 * fast/js/script-tests/break-ASI.js: 12 1 13 2010-10-18 Csaba Osztrogonác <ossy@webkit.org> 2 14 -
trunk/LayoutTests/fast/js/break-ASI-expected.txt
r69906 r69963 10 10 PASS (function(){if (0) return 11 11 ;else return true;})() is true 12 PASS do { if(0) throw 'x';else true; } while (0) is true 12 13 PASS if (0) throw 13 14 'Shouldn't have parsed this.'; threw exception SyntaxError: Parse error. -
trunk/LayoutTests/fast/js/script-tests/break-ASI.js
r69906 r69963 4 4 shouldBeTrue("do { if(0) continue\n;else true; } while (0)") 5 5 shouldBeTrue("(function(){if (0) return\n;else return true;})()") 6 shouldBeTrue("do { if(0) throw 'x';else true; } while (0)") 6 7 shouldThrow("if (0) throw\n'Shouldn\'t have parsed this.';") 7 8
Note: See TracChangeset
for help on using the changeset viewer.