Commit b8a0418d authored by Sathya Gunasekaran's avatar Sathya Gunasekaran Committed by Commit Bot

[Promise] Close iterator if constructor.resolve throws

If the lookup of the resolve property on the constructor throws, we
need to call IteratroClose before rejecting the promise.

Bug: v8:9431
Change-Id: Idb33ffe09d339723ef0cd2469335598ab27b49bf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1701857Reviewed-by: 's avatarMathias Bynens <mathias@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62720}
parent 14274bb1
...@@ -2062,7 +2062,7 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll( ...@@ -2062,7 +2062,7 @@ Node* PromiseBuiltinsAssembler::PerformPromiseAll(
// 5. Let _promiseResolve_ be ? Get(_constructor_, `"resolve"`). // 5. Let _promiseResolve_ be ? Get(_constructor_, `"resolve"`).
TNode<Object> resolve = TNode<Object> resolve =
GetProperty(native_context, constructor, factory()->resolve_string()); GetProperty(native_context, constructor, factory()->resolve_string());
GotoIfException(resolve, if_exception, var_exception); GotoIfException(resolve, &close_iterator, var_exception);
// 6. If IsCallable(_promiseResolve_) is *false*, throw a *TypeError* // 6. If IsCallable(_promiseResolve_) is *false*, throw a *TypeError*
// exception. // exception.
...@@ -2624,7 +2624,7 @@ TF_BUILTIN(PromiseRace, PromiseBuiltinsAssembler) { ...@@ -2624,7 +2624,7 @@ TF_BUILTIN(PromiseRace, PromiseBuiltinsAssembler) {
// 3. Let _promiseResolve_ be ? Get(_constructor_, `"resolve"`). // 3. Let _promiseResolve_ be ? Get(_constructor_, `"resolve"`).
TNode<Object> resolve = TNode<Object> resolve =
GetProperty(native_context, receiver, factory()->resolve_string()); GetProperty(native_context, receiver, factory()->resolve_string());
GotoIfException(resolve, &reject_promise, &var_exception); GotoIfException(resolve, &close_iterator, &var_exception);
// 4. If IsCallable(_promiseResolve_) is *false*, throw a *TypeError* // 4. If IsCallable(_promiseResolve_) is *false*, throw a *TypeError*
// exception. // exception.
......
...@@ -567,11 +567,6 @@ ...@@ -567,11 +567,6 @@
'built-ins/FinalizationGroup/prototype-from-newtarget-custom': [SKIP], 'built-ins/FinalizationGroup/prototype-from-newtarget-custom': [SKIP],
'built-ins/WeakRef/prototype-from-newtarget-custom': [SKIP], 'built-ins/WeakRef/prototype-from-newtarget-custom': [SKIP],
# https://bugs.chromium.org/p/v8/issues/detail?id=9431
'built-ins/Promise/all/invoke-resolve-get-error-close': [FAIL],
'built-ins/Promise/allSettled/invoke-resolve-get-error-close': [FAIL],
'built-ins/Promise/race/invoke-resolve-get-error-close': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=9430 # https://bugs.chromium.org/p/v8/issues/detail?id=9430
'language/statements/class/elements/private-getter-visible-to-direct-eval-on-initializer': [FAIL], 'language/statements/class/elements/private-getter-visible-to-direct-eval-on-initializer': [FAIL],
'language/statements/class/elements/private-method-visible-to-direct-eval-on-initializer': [FAIL], 'language/statements/class/elements/private-method-visible-to-direct-eval-on-initializer': [FAIL],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment