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

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

Issue 552143004: Simplify TONATIVE_*_EXCEPTIONSTATE* macros (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@bindings-conversion-ExceptionState
Patch Set: rebased Created 6 years, 3 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/scripts/v8_methods.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8BindingMacros.h
diff --git a/Source/bindings/core/v8/V8BindingMacros.h b/Source/bindings/core/v8/V8BindingMacros.h
index 798d5b36ec0d8884dd95b740be61987d154a6e17..5afc52ef3f56b6ec8179b8f6733bb9075c119f0c 100644
--- a/Source/bindings/core/v8/V8BindingMacros.h
+++ b/Source/bindings/core/v8/V8BindingMacros.h
@@ -90,36 +90,24 @@ namespace blink {
#define TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(var, value, exceptionState) \
var = (value); \
- if (UNLIKELY(block.HasCaught() || exceptionState.throwIfNeeded())) \
+ if (UNLIKELY(exceptionState.throwIfNeeded())) \
return; \
-#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_VOID_EXCEPTIONSTATE(type, var, value, exceptionState) \
+ type var; \
+ var = (value); \
+ if (UNLIKELY(exceptionState.throwIfNeeded())) \
+ return;
#define TONATIVE_DEFAULT_EXCEPTIONSTATE(type, var, value, exceptionState, retVal) \
- type var; \
- { \
- v8::TryCatch block; \
- V8RethrowTryCatchScope rethrow(block); \
- var = (value); \
- if (UNLIKELY(block.HasCaught() || exceptionState.throwIfNeeded())) \
- return retVal; \
- }
+ type var = (value); \
+ if (UNLIKELY(exceptionState.throwIfNeeded())) \
+ return retVal;
// We need to cancel the exception propergation when we return a rejected
// Promise.
#define TONATIVE_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(var, value, exceptionState, info, scriptState) \
var = (value); \
- if (UNLIKELY(block.HasCaught())) { \
- v8SetReturnValue(info, ScriptPromise::rejectRaw(info.GetIsolate(), block.Exception())); \
- block.Reset(); \
- return; \
- } \
if (UNLIKELY(exceptionState.hadException())) { \
v8SetReturnValue(info, exceptionState.reject(scriptState).v8Value()); \
return; \
@@ -127,10 +115,7 @@ namespace blink {
#define TONATIVE_VOID_EXCEPTIONSTATE_PROMISE(type, var, value, exceptionState, info, scriptState) \
type var; \
- { \
- v8::TryCatch block; \
- TONATIVE_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(var, value, exceptionState, info, scriptState); \
- }
+ TONATIVE_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(var, value, exceptionState, info, scriptState);
// type is an instance of class template V8StringResource<>,
// but Mode argument varies; using type (not Mode) for consistency
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698