Commit 16310b2e authored by jgruber's avatar jgruber Committed by Commit bot

[debugger] Ensure debug listeners do not throw

This exposes a couple of broken tests that used to silently throw within
the listener. Mark these as failing for now

BUG=v8:5330, v8:5581

Review-Url: https://codereview.chromium.org/2460833002
Cr-Commit-Position: refs/heads/master@{#40672}
parent 36f3f909
......@@ -1808,11 +1808,9 @@ class InspectorFrontend final : public v8_inspector::V8Inspector::Channel {
if (callback->IsFunction()) {
v8::TryCatch try_catch(isolate_);
Local<Value> args[] = {message};
if (Local<Function>::Cast(callback)
->Call(context, Undefined(isolate_), 1, args)
.IsEmpty()) {
try_catch.ReThrow();
}
MaybeLocal<Value> result = Local<Function>::Cast(callback)->Call(
context, Undefined(isolate_), 1, args);
CHECK(!result.IsEmpty()); // Listeners may not throw.
}
}
......
......@@ -1850,7 +1850,7 @@ void Debug::CallEventCallback(v8::DebugEvent event,
event_listener_data_,
client_data);
callback(event_details);
DCHECK(!isolate_->has_scheduled_exception());
CHECK(!isolate_->has_scheduled_exception());
} else {
// Invoke the JavaScript debug event listener.
DCHECK(event_listener_->IsJSFunction());
......@@ -1859,8 +1859,10 @@ void Debug::CallEventCallback(v8::DebugEvent event,
event_data,
event_listener_data_ };
Handle<JSReceiver> global = isolate_->global_proxy();
Execution::TryCall(isolate_, Handle<JSFunction>::cast(event_listener_),
global, arraysize(argv), argv);
MaybeHandle<Object> result =
Execution::Call(isolate_, Handle<JSFunction>::cast(event_listener_),
global, arraysize(argv), argv);
CHECK(!result.is_null()); // Listeners may not throw.
}
in_debug_event_listener_ = previous;
}
......
......@@ -69,7 +69,6 @@
##############################################################################
# Too slow in debug mode with --stress-opt mode.
'regress/regress-2318': [PASS, ['mode == debug', SKIP]],
'regress/regress-create-exception': [PASS, ['mode == debug', SKIP]],
##############################################################################
......@@ -135,6 +134,17 @@
'verify-check-false': [FAIL, NO_VARIANTS],
'verify-assert-false': [NO_VARIANTS, ['mode == release and dcheck_always_on == False', PASS], ['mode == debug or dcheck_always_on == True', FAIL]],
##############################################################################
# BUG(5581): Broken tests with exceptions thrown in debug listener.
'es6/debug-step-into-constructor': [FAIL],
'es6/default-parameters-debug': [FAIL],
'regress/regress-2296': [FAIL],
'regress/regress-2318': [FAIL],
'regress/regress-4703': [FAIL],
'regress/regress-5071': [FAIL],
'regress/regress-998565': [FAIL],
'regress/regress-crbug-107996': [FAIL],
##############################################################################
# Tests with different versions for release and debug.
'compiler/alloc-number': [PASS, ['mode == debug', SKIP]],
......
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