archives

« Bugzilla Issues Index

#2732 — 14.2 Arrow Function Definitions: ArrowFormalParameters need [GeneratorParameter] like restriction


14.2 Arrow Function Definitions
---
ArrowFormalParameters[Yield] : ( StrictFormalParameters[?Yield] )
---

Following the production rules StrictFormalParameters -> FormalParameters -> FormalParameterList -> FormalsList -> FormalParameter -> BindingElement -> SingleNameBinding, you'll end up at SingleNameBinding:
---
SingleNameBinding[Yield,GeneratorParameter] :
[+GeneratorParameter] BindingIdentifier[Yield] Initializer[In]opt
[~GeneratorParameter] BindingIdentifier[?Yield] Initializer[In, ?Yield]opt
---

Without the [GeneratorParameter] production parameter, but with [Yield] being present, Initializer -> AssignmentExpression -> YieldExpression can be parsed...


test case:
---
function*g() {
(a = yield) => {}
}
---


fixed in rev25 editor's draft


fixed in rev25 editor's draft