Closed Bug 1089632 Opened 10 years ago Closed 9 years ago

Setter with a RestParameter should be a SyntaxError

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: jorendorff, Assigned: arai)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, site-compat, Whiteboard: [DocArea=JS])

Attachments

(1 file)

Noticed by Waldo in bug 911142, comment 8.

The grammar starts out like this:

    MethodDefinition :
        set PropertyName ( PropertySetParameterList ) { FunctionBody }

    PropertySetParameterList :
        FormalParameter

and it turns out FormalParameter and FunctionRestParameter are two disjoint bits of syntax.

https://people.mozilla.org/~jorendorff/es6-draft.html#sec-method-definitions
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]
Doesn't that actually mean there has to be one single parameter and nothing else?
Comment on attachment 8548192 [details] [diff] [review]
Throw SyntaxError if RestParameter is used in setter.

Review of attachment 8548192 [details] [diff] [review]:
-----------------------------------------------------------------

Mm.  This at least I can polish off quickly.  Sorry I'm taking so long on some of your other patches.  :-(  Promise to get to them soon!
Attachment #8548192 - Flags: review?(jwalden+bmo) → review+
https://hg.mozilla.org/mozilla-central/rev/6a59a5ee91b4
Assignee: nobody → arai_a
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.