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

Unified Diff: Source/bindings/v8/V8BindingMacros.h

Issue 313033002: Rethrow exception when swallowing it is not intended. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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
Index: Source/bindings/v8/V8BindingMacros.h
diff --git a/Source/bindings/v8/V8BindingMacros.h b/Source/bindings/v8/V8BindingMacros.h
index 1dc394acfe3ba66c63af186c05df988d07bff798..1abb3233b80b58d42a3e03bee83d8533635d9449 100644
--- a/Source/bindings/v8/V8BindingMacros.h
+++ b/Source/bindings/v8/V8BindingMacros.h
@@ -71,28 +71,26 @@ namespace WebCore {
}
#define TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(var, value, exceptionState) \
- var = (value); \
- if (UNLIKELY(block.HasCaught())) \
- exceptionState.rethrowV8Exception(block.Exception()); \
- if (UNLIKELY(exceptionState.throwIfNeeded())) \
- return;
+ var = (value); \
+ if (UNLIKELY(block.HasCaught() || exceptionState.throwIfNeeded())) \
+ return; \
-#define TONATIVE_VOID_EXCEPTIONSTATE(type, var, value, exceptionState) \
- type var; \
- { \
- v8::TryCatch block; \
+#define TONATIVE_VOID_EXCEPTIONSTATE(type, var, value, exceptionState) \
+ type var; \
+ { \
+ v8::TryCatch block; \
+ V8RethrowTryCatchScope rethrow(block); \
TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(var, value, exceptionState); \
}
#define TONATIVE_DEFAULT_EXCEPTIONSTATE(type, var, value, exceptionState, retVal) \
- type var; \
- { \
- v8::TryCatch block; \
- var = (value); \
- if (UNLIKELY(block.HasCaught())) \
- exceptionState.rethrowV8Exception(block.Exception()); \
- if (UNLIKELY(exceptionState.throwIfNeeded())) \
- return retVal; \
+ type var; \
+ { \
+ v8::TryCatch block; \
+ V8RethrowTryCatchScope rethrow(block); \
+ var = (value); \
+ if (UNLIKELY(block.HasCaught() || exceptionState.throwIfNeeded())) \
+ return retVal; \
}
// type is an instance of class template V8StringResource<>,
« no previous file with comments | « LayoutTests/fast/dom/TreeWalker/acceptNode-filter-expected.txt ('k') | Source/bindings/v8/V8NodeFilterCondition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698