Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 73ab719b0b4d2ee1473e3297074c7515c4368505
https://github.com/WebKit/WebKit/commit/73ab719b0b4d2ee1473e3297074c7515c4368505
Author: Sosuke Suzuki <[email protected]>
Date: 2025-11-14 (Fri, 14 Nov 2025)
Changed paths:
A JSTests/microbenchmarks/promise-race.js
M JSTests/stress/new-promise-capabilities-requires-constructor.js
A JSTests/stress/promise-race-empty-args.js
A JSTests/stress/promise-race-fast-path-not-thenable.js
A JSTests/stress/promise-race-slow-path-non-thenable.js
A JSTests/stress/promsie-race-resolve-getter-throws.js
M Source/JavaScriptCore/builtins/PromiseConstructor.js
M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
M Source/JavaScriptCore/runtime/JSGlobalObject.h
M Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp
Log Message:
-----------
[JSC] Implement `Promise.race` in C++
https://bugs.webkit.org/show_bug.cgi?id=300569
Reviewed by Yusuke Suzuki.
This reverts commit 302934@main to reland 302567@main.
This patch fixes to crash from original patch by throwing a
TypeError when elements of the argument's iterable are not thenable.
------
This patch changes to implement `Promise.race` in C++.
* JSTests/microbenchmarks/promise-race.js: Added.
* JSTests/stress/new-promise-capabilities-requires-constructor.js:
(shouldThrow):
* JSTests/stress/promise-race-empty-args.js: Added.
(shouldBe):
* JSTests/stress/promise-race-fast-path-not-thenable.js: Added.
(shouldThrowAsync):
(shouldThrowAsync.async var):
* JSTests/stress/promise-race-slow-path-non-thenable.js: Added.
(shouldThrowAsync):
(shouldThrowAsync.async const):
(shouldThrowAsync.Promise.resolve):
* JSTests/stress/promsie-race-resolve-getter-throws.js: Added.
(shouldBe):
* Source/JavaScriptCore/builtins/PromiseConstructor.js:
(any):
(race): Deleted.
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* Source/JavaScriptCore/runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::promiseResolveWatchpointSet):
* Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp:
(JSC::isFastPromiseConstructor):
(JSC::promiseRaceSlow):
(JSC::JSC_DEFINE_HOST_FUNCTION):
Canonical link: https://commits.webkit.org/303034@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications