Setter should have a single formal parameter, Getter no parameters
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Mar 2015 04:20:30 +0000 (04:20 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Mar 2015 04:20:30 +0000 (04:20 +0000)
commit593b8cb8615238c70243af082693ecdb48deabe0
tree2ca5875fbf3c053897acb681c97f68069bb17c68
parent0aa62061428a850c01e259f38f5a072cf0105df9
Setter should have a single formal parameter, Getter no parameters
https://bugs.webkit.org/show_bug.cgi?id=142903

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFunctionInfo):
Enforce no parameters for getters and a single parameter
for setters, with informational error messages.

Source/WebInspectorUI:

* UserInterface/Views/GradientSlider.js:
(WebInspector.GradientSliderKnob.prototype.get wellColor):
Fix a getter that was incorrectly taking a parameter.

LayoutTests:

Correct a bunch of setters in existing tests and add
tests for good/bad getter and setter syntax.

* js/class-syntax-declaration-expected.txt:
* js/dom/exception-sequencing.html:
* js/dom/reserved-words-as-property-expected.txt:
* js/dom/script-tests/implicit-call-with-global-reentry.js:
(testObject.set setterTest):
* js/dom/script-tests/reserved-words-as-property.js:
(testWord):
* js/for-in-cached-expected.txt:
* js/object-literal-direct-put-expected.txt:
* js/object-literal-syntax-expected.txt:
* js/parser-syntax-check-expected.txt:
* js/script-tests/class-syntax-declaration.js:
* js/script-tests/class-syntax-super.js:
(class.Derived.extends.Base.set callBaseMethodInSetter):
(class.Derived.extends.Base.set baseMethodInGetterSetter):
* js/script-tests/for-in-cached.js:
* js/script-tests/object-literal-direct-put.js:
* js/script-tests/object-literal-syntax.js:
* js/script-tests/parser-syntax-check.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181929 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/js/class-syntax-declaration-expected.txt
LayoutTests/js/dom/exception-sequencing.html
LayoutTests/js/dom/reserved-words-as-property-expected.txt
LayoutTests/js/dom/script-tests/implicit-call-with-global-reentry.js
LayoutTests/js/dom/script-tests/reserved-words-as-property.js
LayoutTests/js/for-in-cached-expected.txt
LayoutTests/js/object-literal-direct-put-expected.txt
LayoutTests/js/object-literal-syntax-expected.txt
LayoutTests/js/parser-syntax-check-expected.txt
LayoutTests/js/script-tests/class-syntax-declaration.js
LayoutTests/js/script-tests/class-syntax-super.js
LayoutTests/js/script-tests/for-in-cached.js
LayoutTests/js/script-tests/object-literal-direct-put.js
LayoutTests/js/script-tests/object-literal-syntax.js
LayoutTests/js/script-tests/parser-syntax-check.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Parser.cpp
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/GradientSlider.js