-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
has consensusThis has committee consensus.This has committee consensus.normative changeAffects behavior required to correctly evaluate some ECMAScript source textAffects behavior required to correctly evaluate some ECMAScript source textweb reality
Description
ES2015 and later give a name property to named functions (whether named via declaration, expression, or name inference). Anonymous functions aren't given one, presumably with the expectation that name lookups will read through to Function.prototype.name (which is an empty string).
Yet engines have legacy behavior here:
> eshost -e '(() => {}).hasOwnProperty("name")' // same result for function(){}
#### v8
true
#### jsc
true
#### spidermonkey
true
#### chakra
false
I'd propose that there'd be little downside to specifying this behavior.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
has consensusThis has committee consensus.This has committee consensus.normative changeAffects behavior required to correctly evaluate some ECMAScript source textAffects behavior required to correctly evaluate some ECMAScript source textweb reality