Don't use error value on closeing iterator in Promise builtins

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
Seonghyun Kim 2025-12-26 18:38:10 +09:00 committed by Boram Bae
commit bf4d55e27a
2 changed files with 4 additions and 8 deletions

View file

@ -216,7 +216,7 @@ static Value builtinPromiseAll(ExecutionState& state, Value thisValue, size_t ar
result = IteratorObject::iteratorClose(state, iteratorRecord, exceptionValue, true);
}
} catch (const Value& v) {
exceptionValue = v;
// ignore error value
}
// If value is an abrupt completion,
@ -323,7 +323,7 @@ static Value builtinPromiseRace(ExecutionState& state, Value thisValue, size_t a
result = IteratorObject::iteratorClose(state, record, exceptionValue, true);
}
} catch (const Value& v) {
exceptionValue = v;
// ignore error here
}
// If value is an abrupt completion,
// Perform ? Call(capability.[[Reject]], undefined, « value.[[Value]] »).
@ -565,7 +565,7 @@ static Value builtinPromiseAllSettled(ExecutionState& state, Value thisValue, si
try {
result = IteratorObject::iteratorClose(state, iteratorRecord, exceptionValue, true);
} catch (const Value& v) {
exceptionValue = v;
// ignore error value
// IfAbruptRejectPromise(result, promiseCapability).
// If value is an abrupt completion,
// Perform ? Call(capability.[[Reject]], undefined, « value.[[Value]] »).
@ -731,7 +731,7 @@ static Value builtinPromiseAny(ExecutionState& state, Value thisValue, size_t ar
IteratorObject::iteratorClose(state, iteratorRecord, thrownValue, true);
}
} catch (const Value& v) {
thrownValue = v;
// ignore error here
}
// IfAbruptRejectPromise(result, promiseCapability).
Object::call(state, promiseCapability.m_rejectFunction, Value(), 1, &thrownValue);

View file

@ -134,10 +134,6 @@
<test id="built-ins/Object/freeze/proxy-with-defineProperty-handler"><reason>TODO</reason></test>
<test id="built-ins/Object/freeze/typedarray-backed-by-resizable-buffer"><reason>TODO</reason></test>
<test id="built-ins/Object/seal/proxy-with-defineProperty-handler"><reason>TODO</reason></test>
<test id="built-ins/Promise/all/resolve-throws-iterator-return-is-not-callable"><reason>TODO</reason></test>
<test id="built-ins/Promise/allSettled/resolve-throws-iterator-return-is-not-callable"><reason>TODO</reason></test>
<test id="built-ins/Promise/any/resolve-throws-iterator-return-is-not-callable"><reason>TODO</reason></test>
<test id="built-ins/Promise/race/resolve-throws-iterator-return-is-not-callable"><reason>TODO</reason></test>
<test id="built-ins/ShadowRealm/prototype/evaluate/globalthis-ordinary-object"><reason>TODO</reason></test>
<test id="built-ins/ShadowRealm/prototype/evaluate/wrapped-function-proto-from-caller-realm"><reason>TODO</reason></test>
<test id="built-ins/ShadowRealm/prototype/evaluate/wrapped-function-throws-typeerror-from-caller-realm"><reason>TODO</reason></test>