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

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
« no previous file with comments | « no previous file | Source/bindings/v8/V8NodeFilterCondition.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8BindingMacros.h
diff --git a/Source/bindings/v8/V8BindingMacros.h b/Source/bindings/v8/V8BindingMacros.h
index 1dc394acfe3ba66c63af186c05df988d07bff798..5fb8630d5d587eb53773566871185d4214f1e131 100644
--- a/Source/bindings/v8/V8BindingMacros.h
+++ b/Source/bindings/v8/V8BindingMacros.h
@@ -71,28 +71,34 @@ namespace WebCore {
}
#define TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(var, value, exceptionState) \
- var = (value); \
- if (UNLIKELY(block.HasCaught())) \
- exceptionState.rethrowV8Exception(block.Exception()); \
- if (UNLIKELY(exceptionState.throwIfNeeded())) \
+ var = (value); \
+ if (UNLIKELY(block.HasCaught())) { \
+ exceptionState.rethrowV8Exception(block.Exception()); \
Jens Widell 2014/06/16 11:56:39 Given current usage of this macro and the one belo
yhirano 2014/06/17 11:10:02 Done.
+ return; \
+ } \
+ if (UNLIKELY(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.rethrowV8Exception(block.Exception()); \
+ return retVal; \
+ } \
+ if (UNLIKELY(exceptionState.throwIfNeeded())) \
+ return retVal; \
}
// type is an instance of class template V8StringResource<>,
« no previous file with comments | « no previous file | Source/bindings/v8/V8NodeFilterCondition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698