Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: src/d8.cc

Issue 2511733002: [debugger] handle stack overflow. Fail silently. (Closed)
Patch Set: fix Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/debug/debug-evaluate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index fd9afee8081e2ce87ba8ae4bca2f30e6b245b462..00fb70737fb317acd35657d30be417f6d8bd043c 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -1806,7 +1806,22 @@ class InspectorFrontend final : public v8_inspector::V8Inspector::Channel {
Local<Value> args[] = {message};
MaybeLocal<Value> result = Local<Function>::Cast(callback)->Call(
context, Undefined(isolate_), 1, args);
- CHECK(!result.IsEmpty()); // Listeners may not throw.
+#ifdef DEBUG
+ if (try_catch.HasCaught()) {
+ Local<Object> exception = Local<Object>::Cast(try_catch.Exception());
+ Local<String> key = v8::String::NewFromUtf8(isolate_, "message",
+ v8::NewStringType::kNormal)
+ .ToLocalChecked();
+ Local<String> expected =
+ v8::String::NewFromUtf8(isolate_,
+ "Maximum call stack size exceeded",
+ v8::NewStringType::kNormal)
+ .ToLocalChecked();
+ CHECK(exception->Get(context, key)
+ .ToLocalChecked()
+ ->StrictEquals(expected));
+ }
+#endif
}
}
« no previous file with comments | « no previous file | src/debug/debug-evaluate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698