Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a5f67b2bf6279b2a37c1c499fd82aa7bf0067398
https://github.com/WebKit/WebKit/commit/a5f67b2bf6279b2a37c1c499fd82aa7bf0067398
Author: Sosuke Suzuki <[email protected]>
Date: 2025-12-25 (Thu, 25 Dec 2025)
Changed paths:
A JSTests/microbenchmarks/internal-promise-internal-all.js
A
JSTests/modules/object-prototype-then-should-not-be-called-through-internal-promise.js
A
JSTests/modules/object-prototype-then-should-not-be-called-through-internal-promise/test.js
M Source/JavaScriptCore/CMakeLists.txt
M Source/JavaScriptCore/DerivedSources-input.xcfilelist
M Source/JavaScriptCore/DerivedSources.make
M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
R Source/JavaScriptCore/builtins/InternalPromiseConstructor.js
M Source/JavaScriptCore/runtime/JSInternalPromiseConstructor.cpp
M Source/JavaScriptCore/runtime/JSMicrotask.cpp
M Source/JavaScriptCore/runtime/Microtask.h
Log Message:
-----------
[JSC] Implment `@InternalPromise.@internalAll` in C++
https://bugs.webkit.org/show_bug.cgi?id=303965
Reviewed by Yusuke Suzuki.
This patch reverts 304888@main to reland 304331@main.
The original patch used PromiseAllResolveJob which calls resolve() to settle
the result promise. However, resolve() looks up the "then" property on the
resolution value, which can have user-observable side effects. For example,
if Object.prototype.then is set to a custom function, it would be called
when resolving the result array, breaking the InternalPromise pipeline.
InternalPromise requires using fulfill() instead of resolve() because
fulfill() directly settles the promise without looking up "then". This is
the key difference between InternalPromise and regular Promise - InternalPromise
must not trigger any user-observable operations.
This patch:
- Adds InternalPromiseAllResolveJob which uses fulfill() instead of resolve()
- Updates JSInternalPromiseConstructor to use InternalPromiseAllResolveJob
- Also uses fulfill() for the empty array case
- Adds a test to verify Object.prototype.then is not called through module
loader
---
This patch changes to implement `@InternalPromiseAll.@internalAll` in C++.
TipOfTree Patched
internal-promise-internal-all 7.2714+-0.6089 ^ 4.1862+-0.2744
^ definitely 1.7370x faster
* JSTests/microbenchmarks/internal-promise-internal-all.js: Added.
*
JSTests/modules/object-prototype-then-should-not-be-called-through-internal-promise.js:
Added.
(Object.prototype.then):
*
JSTests/modules/object-prototype-then-should-not-be-called-through-internal-promise/test.js:
Added.
* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/DerivedSources-input.xcfilelist:
* Source/JavaScriptCore/DerivedSources.make:
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/builtins/InternalPromiseConstructor.js: Removed.
* Source/JavaScriptCore/runtime/JSInternalPromiseConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/JSMicrotask.cpp:
(JSC::internalPromiseAllResolveJob):
(JSC::runInternalMicrotask):
* Source/JavaScriptCore/runtime/Microtask.h:
Canonical link: https://commits.webkit.org/304930@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications