Index: src/builtins/builtins-error.cc |
diff --git a/src/builtins/builtins-error.cc b/src/builtins/builtins-error.cc |
index 25cd9a29e46326bd536f223520ff29f2a67c87c0..118fc39d54a7a45d8c9a61e13ff31ee8b969732d 100644 |
--- a/src/builtins/builtins-error.cc |
+++ b/src/builtins/builtins-error.cc |
@@ -44,6 +44,7 @@ BUILTIN(ErrorCaptureStackTrace) { |
Handle<Object> stack_trace = |
isolate->CaptureSimpleStackTrace(object, mode, caller); |
+ if (!stack_trace->IsJSArray()) return *isolate->factory()->undefined_value(); |
Handle<Object> formatted_stack_trace; |
ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |