Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 298547477fa49eaa30040216b0c7d523d4012579..06e3c6113a90eb3a033a22cdea3c2cd66d24744c 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -845,8 +845,14 @@ |
// At this point we cannot create an Error object using its javascript |
// constructor. Instead, we copy the pre-constructed boilerplate and |
// attach the stack trace as a hidden property. |
- Handle<JSObject> boilerplate = stack_overflow_boilerplate(); |
- Handle<JSObject> exception = factory()->CopyJSObject(boilerplate); |
+ Handle<String> key = factory()->stack_overflow_string(); |
+ Handle<Object> boilerplate = |
+ Object::GetProperty(js_builtins_object(), key).ToHandleChecked(); |
+ if (boilerplate->IsUndefined()) { |
+ return Throw(heap()->undefined_value(), nullptr); |
+ } |
+ Handle<JSObject> exception = |
+ factory()->CopyJSObject(Handle<JSObject>::cast(boilerplate)); |
Throw(*exception, nullptr); |
CaptureAndSetSimpleStackTrace(exception, factory()->undefined_value()); |