| Index: Source/bindings/core/v8/V8Initializer.cpp
|
| diff --git a/Source/bindings/core/v8/V8Initializer.cpp b/Source/bindings/core/v8/V8Initializer.cpp
|
| index 552f93ef7f021b4fa284135b312a91fe3a6cac7d..e437247438c62e237095e82bc4f6ceb83b9c33bc 100644
|
| --- a/Source/bindings/core/v8/V8Initializer.cpp
|
| +++ b/Source/bindings/core/v8/V8Initializer.cpp
|
| @@ -248,6 +248,17 @@ static void promiseRejectHandlerInMainThread(v8::PromiseRejectMessage message)
|
| if (!stackTrace.IsEmpty() && stackTrace->GetFrameCount() > 0)
|
| callStack = createScriptCallStack(stackTrace, ScriptCallStack::maxCallStackSizeToCapture, isolate);
|
|
|
| + if (!callStack && V8DOMWrapper::isDOMWrapper(message.GetValue())) {
|
| + // Try to get the stack from a wrapped exception object (e.g. DOMException).
|
| + v8::Handle<v8::Object> obj = v8::Handle<v8::Object>::Cast(message.GetValue());
|
| + v8::Handle<v8::Value> error = V8HiddenValue::getHiddenValue(isolate, obj, V8HiddenValue::error(isolate));
|
| + if (!error.IsEmpty()) {
|
| + stackTrace = v8::Exception::GetStackTrace(error);
|
| + if (!stackTrace.IsEmpty() && stackTrace->GetFrameCount() > 0)
|
| + callStack = createScriptCallStack(stackTrace, ScriptCallStack::maxCallStackSizeToCapture, isolate);
|
| + }
|
| + }
|
| +
|
| ScriptState* scriptState = ScriptState::from(context);
|
| promiseRejectMessageQueue().append(PromiseRejectMessage(ScriptValue(scriptState, promise), callStack));
|
| }
|
|
|