Index: src/runtime/runtime-debug.cc |
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc |
index 5baa151488f1e03cdf16026751ac31c09cd86b6d..8ddc494428f9726df604c0c4808e5666b1cf6c28 100644 |
--- a/src/runtime/runtime-debug.cc |
+++ b/src/runtime/runtime-debug.cc |
@@ -3022,6 +3022,11 @@ RUNTIME_FUNCTION(Runtime_ExecuteInDebugContext) { |
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
DebugScope debug_scope(isolate->debug()); |
+ if (debug_scope.failed()) { |
+ DCHECK(isolate->has_pending_exception()); |
+ return isolate->heap()->exception(); |
+ } |
+ |
Handle<Object> result; |
ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
isolate, result, |
@@ -3037,6 +3042,10 @@ RUNTIME_FUNCTION(Runtime_GetDebugContext) { |
Handle<Context> context; |
{ |
DebugScope debug_scope(isolate->debug()); |
+ if (debug_scope.failed()) { |
+ DCHECK(isolate->has_pending_exception()); |
+ return isolate->heap()->exception(); |
+ } |
context = isolate->debug()->GetDebugContext(); |
} |
if (context.is_null()) return isolate->heap()->undefined_value(); |