RESOLVED INVALID36523
Parser allows getters/setters to have arguments, should throw
https://bugs.webkit.org/show_bug.cgi?id=36523
Summary Parser allows getters/setters to have arguments, should throw
Sam Sneddon [:gsnedders]
Reported 2010-03-24 05:14:10 PDT
Currently the JSC parser allows getters and setters to have arbitrary numbers of arguments passed to them: the ES5 spec only defines getters with no arguments (i.e., "()") and setters with a single argument; as such the current behaviour is an undocumented extension to the syntax of ES. Syntax extensions are inevitably the worst type of extension because they prevent all execution of the script in other engines that don't support them. It'd be preferably to only allow what the spec requires and throw SyntaxError in the other cases.
Attachments
Oliver Hunt
Comment 1 2010-03-24 11:18:46 PDT
We support arbitrary argument counts on getters/setters as it is necessary for firefox compatibility. You should probably bring this up on the es5-discuss list.
Mark S. Miller
Comment 2 2010-03-30 12:05:25 PDT
The Mozilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=554616 is still open and Brendan has stated that they intends to fix this, probably as soon as FF3.7. Thus, it is premature to close this bug as invalid.
Sam Sneddon [:gsnedders]
Comment 3 2011-02-23 17:08:02 PST
The Firefox bug is now closed (fixed in Fx4), so this is no longer invalid in terms of Fx-compat.
Mark S. Miller
Comment 4 2011-02-23 23:14:00 PST
(In reply to comment #3) > The Firefox bug is now closed (fixed in Fx4), so this is no longer invalid in terms of Fx-compat. Yes, this should be reopened. Version 5.0.1 (5533.17.8, r79488) still accepts "({get foo(x){}})", which must be rejected with an early SyntaxError, as FF4 does.
Note You need to log in before you can comment on or make changes to this bug.