Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Intent to prototype: Redeclarable global eval-introduced vars proposal

244 views
Skip to first unread message

Daniel Minor

unread,
Sep 4, 2024, 9:51:42 AM9/4/24
to dev-pl...@mozilla.org
Summary: Currently we keep track of a [[VarNames]] array that prevents redeclaring vars that are introduced by running a sloppy direct `eval` at global scope. These vars are already configurable, because they can be deleted, so this restriction provides little value to web developers, and requires us to do extra work to track the variables. Implementing this proposal will require removing [[VarNames]] and some associated methods, no new code will be written.
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1899303
Specification: https://github.com/tc39/proposal-redeclarable-global-eval-vars
Standards Body: TC39
Platform coverage: All
Preference: None, my plan is to test this on Nightly with ifdef guards for a few release cycles prior to complete removal of the affected code.
Other browsers: V8 never implemented this behaviour, so they are already compliant. JavaScriptCore made the change in https://bugs.webkit.org/show_bug.cgi?id=275821.
test262: Covered by these existing tests: https://searchfox.org/mozilla-central/rev/82ce14a9dc278584b868b2b9c252ba0871a7782b/js/src/tests/jstests.list#684-686

Please let me know if there are any questions or concerns.

Daniel
Reply all
Reply to author
Forward
0 new messages