Index: Source/bindings/scripts/v8_methods.py |
diff --git a/Source/bindings/scripts/v8_methods.py b/Source/bindings/scripts/v8_methods.py |
index 8541c9bd2210c5a75bc94404a26a66e7d52bd322..14c98cfb9c338f8d2a16e52e1b191bea0b5b83d0 100644 |
--- a/Source/bindings/scripts/v8_methods.py |
+++ b/Source/bindings/scripts/v8_methods.py |
@@ -64,17 +64,19 @@ def argument_needs_try_catch(method, argument): |
idl_type.is_callback_interface or |
base_type == 'SerializedScriptValue' or |
(argument.is_variadic and idl_type.is_wrapper_type) or |
+ # Variadic arguments use toImplArguments() with throws excentions via |
+ # its ExceptionState& argmuent. |
+ argument.is_variadic or |
# String and enumeration arguments converted using one of the |
# TOSTRING_* macros except for _PROMISE variants in |
# 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) 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 |
+ (argument.v8_conversion_needs_exception_state and |
not is_clamp)) |
@@ -170,8 +172,9 @@ def method_context(interface, method): |
is_check_security_for_frame or |
is_check_security_for_window or |
any(argument for argument in arguments |
- if argument.idl_type.name == 'SerializedScriptValue' or |
- argument.idl_type.v8_conversion_needs_exception_state), |
+ if (argument.idl_type.name == 'SerializedScriptValue' or |
+ argument.v8_conversion_needs_exception_state or |
+ argument.is_variadic)), |
'idl_type': idl_type.base_type, |
'is_call_with_execution_context': has_extended_attribute_value(method, 'CallWith', 'ExecutionContext'), |
'is_call_with_script_arguments': is_call_with_script_arguments, |
@@ -377,15 +380,16 @@ def v8_value_to_local_cpp_variadic_value(argument, index, return_promise): |
suffix = '' |
- macro = 'TONATIVE_VOID' |
+ macro = 'TONATIVE_VOID_EXCEPTIONSTATE' |
macro_args = [ |
- argument.name, |
- 'toImplArguments<%s>(info, %s)' % (idl_type.cpp_type, index), |
+ argument.name, |
+ 'toImplArguments<%s>(info, %s, exceptionState)' % (idl_type.cpp_type, index), |
+ 'exceptionState', |
] |
if return_promise: |
suffix += '_PROMISE' |
- macro_args.append('info') |
+ macro_args.extend(['info', 'ScriptState::current(info.GetIsolate())']) |
suffix += '_INTERNAL' |
@@ -464,3 +468,10 @@ def argument_default_cpp_value(argument): |
IdlTypeBase.union_arguments = None |
IdlUnionType.union_arguments = property(union_arguments) |
IdlArgument.default_cpp_value = property(argument_default_cpp_value) |
+ |
+ |
+def v8_conversion_needs_exception_state(argument): |
+ return (argument.idl_type.v8_conversion_needs_exception_state or |
+ argument.is_variadic) |
+ |
+IdlArgument.v8_conversion_needs_exception_state = property(v8_conversion_needs_exception_state) |