Chromium Code Reviews| Index: Source/bindings/core/v8/V8ThrowException.cpp |
| diff --git a/Source/bindings/core/v8/V8ThrowException.cpp b/Source/bindings/core/v8/V8ThrowException.cpp |
| index 13be07f40bc91f1c7f5d9f48e710c7875800dd9b..67421e13eacb11cfb7b93ea2fd0bb430ca76b803 100644 |
| --- a/Source/bindings/core/v8/V8ThrowException.cpp |
| +++ b/Source/bindings/core/v8/V8ThrowException.cpp |
| @@ -70,12 +70,16 @@ v8::Handle<v8::Value> V8ThrowException::createDOMException(v8::Isolate* isolate, |
| if (!frame || !BindingSecurity::shouldAllowAccessToFrame(isolate, frame, DoNotReportSecurityError)) |
| sanitizedCreationContext = isolate->GetCurrentContext()->Global(); |
| + v8::TryCatch tryCatch; |
| RefPtrWillBeRawPtr<DOMException> domException = DOMException::create(ec, sanitizedMessage, unsanitizedMessage); |
| v8::Handle<v8::Value> exception = toV8(domException.get(), sanitizedCreationContext, isolate); |
| - if (exception.IsEmpty()) |
| + if (!exception.IsEmpty()) { |
| + if (tryCatch.HasCaught()) |
| + return tryCatch.Exception(); |
| return v8Undefined(); |
| + } |
|
haraken
2015/02/04 09:41:41
I might be misunderstanding but why is this not li
Jens Widell
2015/02/04 09:48:01
Oups, this was meant to be "if (exception.IsEmpty(
Jens Widell
2015/02/04 09:50:52
Done.
|
| // Attach an Error object to the DOMException. This is then lazily used to get the stack value. |
| v8::Handle<v8::Value> error = v8::Exception::Error(v8String(isolate, domException->message())); |