Class body ending with a semicolon throws a SyntaxError
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Apr 2015 04:20:32 +0000 (04:20 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Apr 2015 04:20:32 +0000 (04:20 +0000)
commita7ba2893b04de05c71587d979f26d7120385e724
tree10cff3f88c41cd9ccc9d30952cdca9a8fb7830b0
parent0f108d688a82922484445e813ba6121157f7b1d7
Class body ending with a semicolon throws a SyntaxError
https://bugs.webkit.org/show_bug.cgi?id=144244

Reviewed by Darin Adler.

Source/JavaScriptCore:

The bug was caused by parseClass's inner loop for method definitions not moving onto the next iteration
it encounters a semicolon. As a result, we always expected a method to appear after a semicolon. Fixed
it by continue'ing when it encounters a semicolon.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseClass):

LayoutTests:

Added a regression test for having a semicolon inside the class definition.

* js/class-syntax-semicolon-expected.txt: Added.
* js/class-syntax-semicolon.html: Added.
* js/script-tests/class-syntax-semicolon.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/class-syntax-semicolon-expected.txt [new file with mode: 0644]
LayoutTests/js/class-syntax-semicolon.html [new file with mode: 0644]
LayoutTests/js/script-tests/class-syntax-semicolon.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Parser.cpp