Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 0b2478691bbf347aca4eb847998986ab854cedd4..38c8ed8fed921f3ee8bfdcc8f70e9e5c52e871a5 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -849,9 +849,13 @@ Object* Isolate::StackOverflow() { |
// constructor. Instead, we copy the pre-constructed boilerplate and |
// attach the stack trace as a hidden property. |
Handle<String> key = factory()->stack_overflow_string(); |
- Handle<JSObject> boilerplate = Handle<JSObject>::cast( |
- Object::GetProperty(js_builtins_object(), key).ToHandleChecked()); |
- Handle<JSObject> exception = factory()->CopyJSObject(boilerplate); |
+ Handle<Object> boilerplate = |
+ Object::GetProperty(js_builtins_object(), key).ToHandleChecked(); |
+ if (boilerplate->IsUndefined()) { |
+ return Throw(heap()->undefined_value(), nullptr); |
Igor Sheludko
2015/05/27 14:33:57
Maybe it is better to throw "stack overflow" inste
Yang
2015/05/29 11:04:52
When does this actually happen?
Igor Sheludko
2015/05/29 11:14:42
The test case attached calls %DebugGetLoadedScript
|
+ } |
+ Handle<JSObject> exception = |
+ factory()->CopyJSObject(Handle<JSObject>::cast(boilerplate)); |
Throw(*exception, nullptr); |
CaptureAndSetSimpleStackTrace(exception, factory()->undefined_value()); |