Phabricator will be unavailable due to database maintenance from 14:00 UTC until 18:00 UTC on Saturday, October 13, 2018.
Bugzilla will remain up during this time. All users have been logged out of Bugzilla

B.3.3.3 always calls CreateGlobalFunctionBinding when in global scope

RESOLVED INVALID

Status

()

RESOLVED INVALID
2 years ago
2 years ago

People

(Reporter: anba, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(firefox52 affected)

Details

(Reporter)

Description

2 years ago
Test case:
---
var f = "x";
eval("print(f); { function f(){} }")
---

Expected: Prints "undefined"
Actual: Prints "x"

V8 and Chakra print "x", JSC prints "function f() {  }".


ES2017 spec: B.3.3.3, step 7.a.i.i
https://tc39.github.io/ecma262/#sec-web-compat-evaldeclarationinstantiation
And more Annex B fun!
Flags: needinfo?(shu)

Comment 2

2 years ago
This is patently bizarre and seems like a spec bug. Why should an Annex B synthesized var unconditionally overwrite an existing global var? I'll ask committee.
The ecma262 related to this is https://github.com/tc39/ecma262/issues/753.

Comment 4

2 years ago
TC39 reached consensus that this peculiarity was a spec bug, so marking as INVALID.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Flags: needinfo?(shu)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.