Getter or setter method named "prototype" or "constrcutor" should throw SyntaxError
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Apr 2015 04:18:18 +0000 (04:18 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Apr 2015 04:18:18 +0000 (04:18 +0000)
commit0f108d688a82922484445e813ba6121157f7b1d7
treef3e052fada1ef2ce2a20b002fa39b1280bf8559d
parent563f3c7f6e1634e0e0f30ab868a87c7144e2c916
Getter or setter method named "prototype" or "constrcutor" should throw SyntaxError
https://bugs.webkit.org/show_bug.cgi?id=144243

Reviewed by Darin Adler.

Source/JavaScriptCore:

Fixed the bug by adding explicit checks in parseGetterSetter when we're parsing class methods.

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

LayoutTests:

Added tests cases to both tests. Also added test cases missing from expression tests.

* js/class-syntax-declaration-expected.txt:
* js/class-syntax-expression-expected.txt:
* js/script-tests/class-syntax-declaration.js:
* js/script-tests/class-syntax-expression.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/class-syntax-declaration-expected.txt
LayoutTests/js/class-syntax-expression-expected.txt
LayoutTests/js/script-tests/class-syntax-declaration.js
LayoutTests/js/script-tests/class-syntax-expression.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Parser.cpp