Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 707b16ac07ea24da0fdc343968c092eaf3b91dfc
https://github.com/WebKit/WebKit/commit/707b16ac07ea24da0fdc343968c092eaf3b91dfc
Author: Alistair Smith <[email protected]>
Date: 2026-07-10 (Fri, 10 Jul 2026)
Changed paths:
A JSTests/stress/promise-resolve-thenable-job-species-throws.js
M Source/JavaScriptCore/runtime/JSMicrotask.cpp
Log Message:
-----------
PromiseResolveThenableJob should reject the promise when SpeciesConstructor
throws
https://bugs.webkit.org/show_bug.cgi?id=318399
Reviewed by Yusuke Suzuki.
new Promise(r => r(p)) never settles when p is a Promise whose own
constructor[@@species] getter throws: promiseResolveThenableJobFastSlow
and its WithInternalMicrotask twin called promiseSpeciesConstructor
before creating the resolving functions and returned on the exception,
leaving nothing to reject. Per NewPromiseResolveThenableJob step c
(ECMA-262 27.2.2.2), the abrupt completion of the then call must reject
the promise. Create the resolving functions first (pure allocation,
cannot throw) and let the existing reject tail handle the exception.
Regressed in the C++ port of the promise jobs (bug 300130).
* JSTests/stress/promise-resolve-thenable-job-species-throws.js: Added.
* Source/JavaScriptCore/runtime/JSMicrotask.cpp:
(JSC::promiseResolveThenableJobFastSlow):
(JSC::promiseResolveThenableJobWithInternalMicrotaskFastSlow):
Canonical link: https://commits.webkit.org/316937@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications