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

Unified Diff: Source/bindings/scripts/v8_methods.py

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 | « Source/bindings/core/v8/V8BindingMacros.h ('k') | Source/bindings/tests/results/core/V8TestInterface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_methods.py
diff --git a/Source/bindings/scripts/v8_methods.py b/Source/bindings/scripts/v8_methods.py
index 4fb2ec0d329300607a41a03c7e88541494b71d0f..8541c9bd2210c5a75bc94404a26a66e7d52bd322 100644
--- a/Source/bindings/scripts/v8_methods.py
+++ b/Source/bindings/scripts/v8_methods.py
@@ -54,6 +54,7 @@ CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES = frozenset([
def argument_needs_try_catch(method, argument):
return_promise = method.idl_type and method.idl_type.name == 'Promise'
+ is_clamp = 'Clamp' in argument.extended_attributes
idl_type = argument.idl_type
base_type = idl_type.base_type
@@ -68,7 +69,13 @@ def argument_needs_try_catch(method, argument):
# Source/bindings/core/v8/V8BindingMacros.h don't use a v8::TryCatch.
((base_type == 'DOMString' or idl_type.is_enum) and
not argument.is_variadic and
- not return_promise))
+ not return_promise) or
+ # Conversion that take an ExceptionState& argument throw all their
+ # exceptions via it, and doesn't need/use a TryCatch, except if the
+ # argument has [Clamp], in which case it uses a separate code path in
+ # Source/bindings/templates/methods.cpp, which *does* use a TryCatch.
+ (idl_type.v8_conversion_needs_exception_state and
+ not is_clamp))
def use_local_result(method):
« no previous file with comments | « Source/bindings/core/v8/V8BindingMacros.h ('k') | Source/bindings/tests/results/core/V8TestInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698