Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Unified Diff: Source/bindings/core/v8/V8ThrowException.cpp

Issue 871403007: Make exception throwing more robust in V8 out-of-stack situations (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/core/v8/V8PerContextData.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0e66afcab65787bcfc324dc57955b3fc9bd0f5da 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())
- return v8Undefined();
+ if (tryCatch.HasCaught()) {
+ ASSERT(exception.IsEmpty());
+ return tryCatch.Exception();
+ }
+ ASSERT(!exception.IsEmpty());
// 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()));
« no previous file with comments | « Source/bindings/core/v8/V8PerContextData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698