Commit 4dc42533 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[devtools] Don't show errors in Sources panel popovers.

When hovering an expression within the Sources panel (during debugging),
we try to evaluate it's value and show a popover with the result of
that. However this is all best effort and might fail for various
reasons. If it fails because we guessed the wrong substring (for an
expression), we currently display a popover with a SyntaxError or a
ReferenceError in that. But this popover is confusing and doesn't serve
a purpose. Instead we should just not display anything in this case as
well.

Bug: chromium:995036
Change-Id: Id70e2212fe0af58078b2a33731688ec1c5507434
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1831814
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701465}
parent 5f6f64dc
......@@ -502,7 +502,7 @@ Sources.DebuggerPlugin = class extends Sources.UISourceCodeFrame.Plugin {
returnByValue: false,
generatePreview: false
});
if (!result.object) {
if (!result.object || (result.object.type === 'object' && result.object.subtype === 'error')) {
return false;
}
objectPopoverHelper = await ObjectUI.ObjectPopoverHelper.buildObjectPopover(result.object, popover);
......
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