Commit da698896 authored by jgruber's avatar jgruber Committed by Commit bot

Handle failed stack trace captures

BUG=630953
R=yangguo@chromium.org

Review-Url: https://codereview.chromium.org/2191713004
Cr-Commit-Position: refs/heads/master@{#38131}
parent 0f62a0e7
...@@ -44,6 +44,7 @@ BUILTIN(ErrorCaptureStackTrace) { ...@@ -44,6 +44,7 @@ BUILTIN(ErrorCaptureStackTrace) {
Handle<Object> stack_trace = Handle<Object> stack_trace =
isolate->CaptureSimpleStackTrace(object, mode, caller); isolate->CaptureSimpleStackTrace(object, mode, caller);
if (!stack_trace->IsJSArray()) return *isolate->factory()->undefined_value();
Handle<Object> formatted_stack_trace; Handle<Object> formatted_stack_trace;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION( ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
......
...@@ -395,3 +395,8 @@ Error.prepareStackTrace = function(e, frames) { throw 42; } ...@@ -395,3 +395,8 @@ Error.prepareStackTrace = function(e, frames) { throw 42; }
var x = {} var x = {}
assertThrows(() => Error.captureStackTrace(x)); assertThrows(() => Error.captureStackTrace(x));
// Check that we don't crash when CaptureSimpleStackTrace returns undefined.
var o = {};
Error.stackTraceLimit = "not a number";
Error.captureStackTrace(o);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment