Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 775c66f97c1049f8e75d9715fb0a684ba71e8dda
https://github.com/WebKit/WebKit/commit/775c66f97c1049f8e75d9715fb0a684ba71e8dda
Author: Alexey Shvayka <[email protected]>
Date: 2024-06-24 (Mon, 24 Jun 2024)
Changed paths:
M
JSTests/stress/global-add-function-should-not-be-shadowed-by-lexical-bindings.js
M
JSTests/stress/global-add-var-should-not-be-shadowed-by-lexical-bindings.js
M JSTests/stress/has-var-declaration.js
M JSTests/test262/expectations.yaml
M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
M Source/JavaScriptCore/runtime/JSGlobalObject.h
M Source/JavaScriptCore/runtime/JSGlobalObjectInlines.h
M Source/JavaScriptCore/runtime/ProgramExecutable.cpp
Log Message:
-----------
[JSC] Remove JSGlobalObject::hasVarDeclaration()
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]: https://github.com/WebKit/WebKit/pull/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
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes