-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[JSC] Remove JSGlobalObject::hasVarDeclaration() #30121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JSC] Remove JSGlobalObject::hasVarDeclaration() #30121
Conversation
EWS run on current version of this PR (hash 881534f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me too
https://bugs.webkit.org/show_bug.cgi?id=275821 <rdar://problem/130438575> Reviewed by Justin Michaud and Yijia Huang. This change implements stage 3 proposal [1] to remove [[VarNames]] from global object, which purpose was to prevent redeclaration of `var` and `function` bindings that were declared via eval(). However, those bindings are configurable and thus still were redeclarable following `delete`. The proposal simplified both mental model of redeclaration constraints and its implementation. This patch effectively reverts [2] and aligns JSC with V8. [1]: https://github.com/tc39/proposal-redeclarable-global-eval-vars [2]: WebKit#17662 * JSTests/stress/global-add-function-should-not-be-shadowed-by-lexical-bindings.js: * JSTests/stress/global-add-var-should-not-be-shadowed-by-lexical-bindings.js: * JSTests/stress/has-var-declaration.js: * JSTests/test262/expectations.yaml: Mark 1 test as passing. * Source/JavaScriptCore/runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::createGlobalFunctionBinding): (JSC::JSGlobalObject::addStaticGlobals): (JSC::JSGlobalObject::deleteProperty): Deleted. * Source/JavaScriptCore/runtime/JSGlobalObject.h: * Source/JavaScriptCore/runtime/JSGlobalObjectInlines.h: (JSC::JSGlobalObject::createGlobalVarBinding): (JSC::JSGlobalObject::hasVarDeclaration): Deleted. * Source/JavaScriptCore/runtime/ProgramExecutable.cpp: (JSC::ProgramExecutable::initializeGlobalProperties): Canonical link: https://commits.webkit.org/280316@main
881534f
to
775c66f
Compare
Committed 280316@main (775c66f): https://commits.webkit.org/280316@main Reviewed commits have been landed. Closing PR #30121 and removing active labels. |
775c66f
881534f
🧪 api-ios