Skip to content

[JSC] Apply Promise.try spec change - #71735

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
Constellation:promise-try-update
Aug 17, 2026
Merged

webkit-commit-queue merged 1 commit into
WebKit:mainfrom
Constellation:promise-try-update

Conversation

@Constellation

@Constellation Constellation commented Aug 16, 2026 •

Copy link
Copy Markdown
Member

7f38ebb

[JSC] Apply Promise.try spec change
https://bugs.webkit.org/show_bug.cgi?id=321890
rdar://185064567

Reviewed by Sosuke Suzuki.

Test262 is updated[1] to include the latest spec change proposal
for Promise.try[2], which uses PromiseResolve instead of a promise
created by NewPromiseCapability. This simplifies our Promise.try
implementation since we can just use @promiseResolve and @promiseReject
helpers instead. Also this removes the reference to
@newPromiseCapability in JSC code. So we drop PromiseOperations.js and
its JS builtins, and replace @newPromiseCapability with C++ version for
remaining WebCore users.

WebCore users can be replaced by using normal Promise + first-resolving
handler. This is fixed in a subsequent change.

[1]: tc39/test262#5072
[2]: tc39/ecma262#3883

* JSTests/test262/expectations.yaml:
* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/DerivedSources-input.xcfilelist:
* Source/JavaScriptCore/DerivedSources.make:
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/builtins/BuiltinNames.h:
* Source/JavaScriptCore/builtins/PromiseConstructor.js:
(try):
* Source/JavaScriptCore/builtins/PromiseOperations.js: Removed.
* Source/JavaScriptCore/bytecode/LinkTimeConstant.h:
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSGlobalObject::init):

Canonical link: https://commits.webkit.org/319276@main

d3733f6

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
❌ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ✅ 🛠 ios-apple
loading 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2   🧪 win-tests ✅ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe ✅ 🛠 vision-apple
loading 🧪 webkitpy ✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug ✅ 🧪 jsc-wpe
✅ 🧪 jsc-x86-64 ✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk3-gcc
✅ 🛠 🧪 jsc-debug-arm64 ✅ 🛠 ios-safer-cpp ✅ 🧪 mac-AS-debug-wk2 ✅ 🛠 gtk
⏳ 🧪 services ✅ 🛠 vision ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-intel-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 unsafe-merge ✅ 🧪 vision-wk2 ✅ 🛠 mac-safer-cpp ✅ 🛠 playstation
✅ 🛠 tv ✅ 🧪 mac-site-isolation
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@Constellation
Constellation requested a review from a team as a code owner August 16, 2026 23:16
@Constellation Constellation self-assigned this Aug 16, 2026
@Constellation Constellation added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label Aug 16, 2026
@Constellation Constellation added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Aug 17, 2026
https://bugs.webkit.org/show_bug.cgi?id=321890
rdar://185064567

Reviewed by Sosuke Suzuki.

Test262 is updated[1] to include the latest spec change proposal
for Promise.try[2], which uses PromiseResolve instead of a promise
created by NewPromiseCapability. This simplifies our Promise.try
implementation since we can just use @promiseResolve and @promisereject
helpers instead. Also this removes the reference to
@newPromiseCapability in JSC code. So we drop PromiseOperations.js and
its JS builtins, and replace @newPromiseCapability with C++ version for
remaining WebCore users.

WebCore users can be replaced by using normal Promise + first-resolving
handler. This is fixed in a subsequent change.

[1]: tc39/test262#5072
[2]: tc39/ecma262#3883

* JSTests/test262/expectations.yaml:
* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/DerivedSources-input.xcfilelist:
* Source/JavaScriptCore/DerivedSources.make:
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/builtins/BuiltinNames.h:
* Source/JavaScriptCore/builtins/PromiseConstructor.js:
(try):
* Source/JavaScriptCore/builtins/PromiseOperations.js: Removed.
* Source/JavaScriptCore/bytecode/LinkTimeConstant.h:
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSGlobalObject::init):

Canonical link: https://commits.webkit.org/319276@main
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 319276@main (7f38ebb): https://commits.webkit.org/319276@main

Reviewed commits have been landed. Closing PR #71735 and removing active labels.

@webkit-commit-queue
webkit-commit-queue merged commit 7f38ebb into WebKit:main Aug 17, 2026
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Aug 17, 2026
@Constellation
Constellation deleted the promise-try-update branch August 18, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants