Commit af03c93b authored by Benedikt Meurer's avatar Benedikt Meurer Committed by V8 LUCI CQ

[inspector] Treat rejected promises like exceptions for eager eval.

When eagerly evaluating native accessors in the inspector, treat
rejected promises the same way that we treat exceptions, and also make
sure to mark them as handled, so they are not logged as unhandled
promise rejections by Chromium.

Also-By: jarin@chromium.org
Bug: chromium:1076820, chromium:1199247
Change-Id: I3cef1e7c04ecbf9e734db946d669a3b5186eca5b
Fixed: chromium:1241298
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3110610
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76432}
parent 787aa571
......@@ -1296,9 +1296,14 @@ bool ValueMirror::getProperties(v8::Local<v8::Context> context,
if (v8::debug::CallFunctionOn(context, getterFunction, object, 0,
nullptr, true)
.ToLocal(&value)) {
valueMirror = ValueMirror::create(context, value);
setterMirror = nullptr;
getterMirror = nullptr;
if (value->IsPromise() &&
value.As<v8::Promise>()->State() == v8::Promise::kRejected) {
value.As<v8::Promise>()->MarkAsHandled();
} else {
valueMirror = ValueMirror::create(context, value);
setterMirror = nullptr;
getterMirror = nullptr;
}
}
}
}
......
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