Summary: | Global lexical declarations should shadow configurable global properties | ||
---|---|---|---|
Product: | WebKit | Reporter: | Elliott Sprehn <esprehn> |
Component: | JavaScriptCore | Assignee: | Ryosuke Niwa <rniwa> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | adamk, ggaren, keith_miller, rniwa, saam, ysuzuki |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Description
Elliott Sprehn
2016-01-25 13:18:54 PST
This is still broken, I think something is wrong in your lexical scoping. I just checked today's nightly: r202375 and it still happens. In general, it seems that JSC refuses to create lexical bindings that shadow configurable properties on the global object, contra the spec (see https://tc39.github.io/ecma262/#sec-hasrestrictedglobalproperty). Here's a DOM-less repro: >>> let Array = 5 Exception: SyntaxError: Can't create duplicate variable that shadows a global property: 'Array' or one with a self-created property: >>> Object.defineProperty(this, 'foo', {value: 5, configurable: true, writable: true}) [object global] >>> let foo = 10 Exception: SyntaxError: Can't create duplicate variable that shadows a global property: 'Foo' *** This bug has been marked as a duplicate of bug 148763 *** |