This repository has been archived by the owner on Oct 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
[spec] accept optional arguments to pass to the callback #16
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Feb 7, 2024
Closed
webkit-commit-queue
pushed a commit
to rkirsling/WebKit
that referenced
this pull request
Feb 21, 2024
https://bugs.webkit.org/show_bug.cgi?id=269775 Reviewed by Justin Michaud. This patch implements https://github.com/tc39/proposal-promise-try behind a runtime option; the proposal is currently at Stage 2 but the spec is very simple and not expected to change. Effectively, Promise.try(f) is a more convenient way to write `new Promise((resolve) => { resolve(f()); })` -- we don't care whether f is sync or async, but if is synchronous, we want it to be executed immediately. This implementation includes tc39/proposal-promise-try#16, which the champion expects to merge; it simply extends the API to Promise.try(f, ...args) such that arguments can be forwarded to the callback. * JSTests/stress/promise-try.js: Added. * Source/JavaScriptCore/builtins/PromiseConstructor.js: (try): Added. * Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp: (JSC::JSPromiseConstructor::finishCreation): * Source/JavaScriptCore/runtime/OptionsList.h: Canonical link: https://commits.webkit.org/275081@main
syg
approved these changes
Apr 8, 2024
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.
lgtm
michaelficarra
approved these changes
Apr 8, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #9