Status: New
Owner: ----

New issue 3983 by [email protected]: Incorrect restriction on binding identifiers of function expressions
https://code.google.com/p/v8/issues/detail?id=3983

Version: 22d62cea4d4d01d30286411cd11a6f3e15083cc0 (Thu Mar 19 08:04:47 2015 -0700)
OS: Ubuntu Linux
Architecture: x64

V8 does not currently allow `yield` as a BindingIdentifier for function
expressions within generator function bodies:

    d8> function f() { (function yield() {}); }
    undefined
    d8> function* g() { (function yield() {}); }
    (d8):1: SyntaxError: Unexpected identifier
    function* g() { (function yield() {}); }
                              ^^^^^
    SyntaxError: Unexpected identifier

ES6 A.4 [1] defines the grammar for function expressions as follows:

FunctionExpression :
function BindingIdentifier opt ( FormalParameters ) { FunctionBody }

Because this definition does *not* include the [Yield] production parameter,
`yield` is a valid identifier in this context. (Note: this bug was originally
identified by André Bargull while we migrated V8 tests to the Test262 suite
https://github.com/tc39/test262/pull/204#discussion_r26884899 .)

[1] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-functions-and-classes

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to