Closed Bug 554616 Opened 15 years ago Closed 15 years ago

Parser allows getters/setters to have arguments, should throw

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 536472

People

(Reporter: gsnedders, Unassigned)

References

()

Details

User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2 Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2 Currently the 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. Reproducible: Always Steps to Reproduce: 1. Visit URL Actual Results: It should say "PASS" and not "FAIL" on all lines. Expected Results: It says "FAIL" for the last four lines. Also in Minefield from yesterday (though that's on a remote machine and copy/paste doesn't work from it, so no UA from that).
Blocks: es5
Status: UNCONFIRMED → NEW
Ever confirmed: true
Easy "my first bug" to patch. /be
Whiteboard: good first bug
Whiteboard: good first bug → [good first bug]
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
Whiteboard: [good first bug]
You need to log in before you can comment on or make changes to this bug.