Commit 36d4e8e1 authored by Yang Guo's avatar Yang Guo Committed by V8 LUCI CQ

Remove dead code around catch scope for desugaring

Bug: none
Change-Id: I634631515e392198c5a6c885ab033035ead97f25
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3003468Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75563}
parent a41f5bee
......@@ -2898,14 +2898,6 @@ class AstNodeFactory final {
HandlerTable::UNCAUGHT, pos);
}
TryCatchStatement* NewTryCatchStatementForDesugaring(Block* try_block,
Scope* scope,
Block* catch_block,
int pos) {
return zone_->New<TryCatchStatement>(try_block, scope, catch_block,
HandlerTable::DESUGARING, pos);
}
TryCatchStatement* NewTryCatchStatementForAsyncAwait(Block* try_block,
Scope* scope,
Block* catch_block,
......
......@@ -1038,9 +1038,6 @@ void AstPrinter::VisitTryCatchStatement(TryCatchStatement* node) {
case HandlerTable::CAUGHT:
prediction = "CAUGHT";
break;
case HandlerTable::DESUGARING:
prediction = "DESUGARING";
break;
case HandlerTable::ASYNC_AWAIT:
prediction = "ASYNC_AWAIT";
break;
......
......@@ -40,10 +40,6 @@ class V8_EXPORT_PRIVATE HandlerTable {
UNCAUGHT, // The handler will (likely) rethrow the exception.
CAUGHT, // The exception will be caught by the handler.
PROMISE, // The exception will be caught and cause a promise rejection.
DESUGARING, // The exception will be caught, but both the exception and
// the catching are part of a desugaring and should therefore
// not be visible to the user (we won't notify the debugger of
// such exceptions).
ASYNC_AWAIT, // The exception will be caught and cause a promise rejection
// in the desugaring of an async function, so special
// async/await handling in the debugger can take place.
......
......@@ -1980,9 +1980,6 @@ void Debug::OnException(Handle<Object> exception, Handle<Object> promise,
Isolate::CatchType catch_type = isolate_->PredictExceptionCatcher();
// Don't notify listener of exceptions that are internal to a desugaring.
if (catch_type == Isolate::CAUGHT_BY_DESUGARING) return;
bool uncaught = catch_type == Isolate::NOT_CAUGHT;
if (promise->IsJSObject()) {
Handle<JSObject> jspromise = Handle<JSObject>::cast(promise);
......
......@@ -2005,8 +2005,6 @@ Isolate::CatchType ToCatchType(HandlerTable::CatchPrediction prediction) {
return Isolate::CAUGHT_BY_JAVASCRIPT;
case HandlerTable::PROMISE:
return Isolate::CAUGHT_BY_PROMISE;
case HandlerTable::DESUGARING:
return Isolate::CAUGHT_BY_DESUGARING;
case HandlerTable::UNCAUGHT_ASYNC_AWAIT:
case HandlerTable::ASYNC_AWAIT:
return Isolate::CAUGHT_BY_ASYNC_AWAIT;
......@@ -2525,7 +2523,6 @@ Handle<Object> Isolate::GetPromiseOnStackOnThrow() {
case HandlerTable::UNCAUGHT:
continue;
case HandlerTable::CAUGHT:
case HandlerTable::DESUGARING:
if (retval->IsJSPromise()) {
// Caught the result of an inner async/await invocation.
// Mark the inner promise as caught in the "synchronous case" so
......
......@@ -935,7 +935,6 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
NOT_CAUGHT,
CAUGHT_BY_JAVASCRIPT,
CAUGHT_BY_EXTERNAL,
CAUGHT_BY_DESUGARING,
CAUGHT_BY_PROMISE,
CAUGHT_BY_ASYNC_AWAIT
};
......
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