diff --git a/src/contexts.h b/src/contexts.h index 66d23f0c09..cbfb99383b 100644 --- a/src/contexts.h +++ b/src/contexts.h @@ -107,8 +107,6 @@ enum ContextLookupFlags { V(PROMISE_ID_RESOLVE_HANDLER_INDEX, JSFunction, promise_id_resolve_handler) \ V(PROMISE_ID_REJECT_HANDLER_INDEX, JSFunction, promise_id_reject_handler) \ V(RANGE_ERROR_FUNCTION_INDEX, JSFunction, range_error_function) \ - V(REJECT_PROMISE_NO_DEBUG_EVENT_INDEX, JSFunction, \ - reject_promise_no_debug_event) \ V(REFERENCE_ERROR_FUNCTION_INDEX, JSFunction, reference_error_function) \ V(SET_ADD_METHOD_INDEX, JSFunction, set_add) \ V(SET_DELETE_METHOD_INDEX, JSFunction, set_delete) \ diff --git a/src/js/async-await.js b/src/js/async-await.js index f0104ed9ac..079a5fcaa4 100644 --- a/src/js/async-await.js +++ b/src/js/async-await.js @@ -106,11 +106,6 @@ function AsyncFunctionAwaitCaught(generator, awaited, outerPromise) { AsyncFunctionAwait(generator, awaited, outerPromise); } -// How the parser rejects promises from async/await desugaring -function RejectPromiseNoDebugEvent(promise, reason) { - return %promise_internal_reject(promise, reason, false); -} - function AsyncFunctionPromiseCreate() { var promise = %promise_internal_constructor(UNDEFINED); if (DEBUG_IS_ACTIVE) { @@ -135,7 +130,6 @@ function AsyncFunctionPromiseRelease(promise) { %InstallToContext([ "async_function_await_caught", AsyncFunctionAwaitCaught, "async_function_await_uncaught", AsyncFunctionAwaitUncaught, - "reject_promise_no_debug_event", RejectPromiseNoDebugEvent, "async_function_promise_create", AsyncFunctionPromiseCreate, "async_function_promise_release", AsyncFunctionPromiseRelease, ]); diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc index 07ad607d37..dcb973da78 100644 --- a/src/parsing/parser.cc +++ b/src/parsing/parser.cc @@ -3018,15 +3018,15 @@ Expression* Parser::BuildResolvePromise(Expression* value, int pos) { } Expression* Parser::BuildRejectPromise(Expression* value, int pos) { - // %RejectPromiseNoDebugEvent(.promise, value, true), .promise - // The NoDebugEvent variant disables the additional debug event for the - // rejection since a debug event already happened for the exception that got - // us here. - ZoneList* args = new (zone()) ZoneList(2, zone()); + // %promise_internal_reject(.promise, value, false), .promise + // Disables the additional debug event for the rejection since a debug event + // already happened for the exception that got us here. + ZoneList* args = new (zone()) ZoneList(3, zone()); args->Add(factory()->NewVariableProxy(PromiseVariable()), zone()); args->Add(value, zone()); + args->Add(factory()->NewBooleanLiteral(false, pos), zone()); Expression* call_runtime = factory()->NewCallRuntime( - Context::REJECT_PROMISE_NO_DEBUG_EVENT_INDEX, args, pos); + Context::PROMISE_INTERNAL_REJECT_INDEX, args, pos); return factory()->NewBinaryOperation( Token::COMMA, call_runtime, factory()->NewVariableProxy(PromiseVariable()), pos);