| Index: Source/bindings/templates/methods.cpp
|
| diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp
|
| index 94b70730869b707916dfc76315938738c13565d4..5726897ac7e85f378979afc0deed61991a912242 100644
|
| --- a/Source/bindings/templates/methods.cpp
|
| +++ b/Source/bindings/templates/methods.cpp
|
| @@ -1,7 +1,7 @@
|
| {##############################################################################}
|
| {% macro generate_method(method, world_suffix) %}
|
| {% filter conditional(method.conditional_string) %}
|
| -static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| +static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info{% if method.overload_index %}, int typeCheckedArgumentIndex{% endif %})
|
| {
|
| {# Local variables #}
|
| {% if method.has_exception_state %}
|
| @@ -172,7 +172,18 @@ if (!isUndefinedOrNull(info[{{argument.index}}]) && !info[{{argument.index}}]->I
|
| }
|
| {{argument.v8_value_to_local_cpp_value}};
|
| {% else %}{# argument.is_nullable #}
|
| +{# Optionally do an "unsafe" type conversion if meaningful for this argument's
|
| + type and if this method is overloaded and the argument's type was checked as
|
| + part of overload resolution for this particular call. #}
|
| +{% if argument.is_ever_distinguishing_argument and
|
| + argument.v8_value_to_local_cpp_value_without_type_check %}
|
| +if (typeCheckedArgumentIndex == {{argument.index}})
|
| + {{argument.v8_value_to_local_cpp_value_without_type_check}};
|
| +else
|
| + {{argument.v8_value_to_local_cpp_value}};
|
| +{% else %}
|
| {{argument.v8_value_to_local_cpp_value}};
|
| +{% endif %}
|
| {% endif %}{# argument.is_nullable #}
|
| {# Type checking, possibly throw a TypeError, per:
|
| http://www.w3.org/TR/WebIDL/#es-type-mapping #}
|
| @@ -377,7 +388,7 @@ static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI
|
| {# 10. If i = d, then: #}
|
| case {{length}}:
|
| {# Then resolve by testing argument #}
|
| - {% for test, method in tests_methods %}
|
| + {% for test, method, typed_checked_argument_index in tests_methods %}
|
| {% filter runtime_enabled(not overloads.runtime_enabled_function_all and
|
| method.runtime_enabled_function) %}
|
| if ({{test}}) {
|
| @@ -387,7 +398,7 @@ static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI
|
| {% if method.deprecate_as and not overloads.deprecate_all_as %}
|
| UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), UseCounter::{{method.deprecate_as}});
|
| {% endif %}
|
| - {{method.name}}{{method.overload_index}}Method{{world_suffix}}(info);
|
| + {{method.name}}{{method.overload_index}}Method{{world_suffix}}(info, {{typed_checked_argument_index}});
|
| return;
|
| }
|
| {% endfilter %}
|
| @@ -547,7 +558,7 @@ bool {{v8_class}}::PrivateScript::{{method.name}}Method({{method.argument_declar
|
| {% set name = '%sConstructorCallback' % v8_class
|
| if constructor.is_named_constructor else
|
| 'constructor%s' % (constructor.overload_index or '') %}
|
| -static void {{name}}(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| +static void {{name}}(const v8::FunctionCallbackInfo<v8::Value>& info{% if constructor.overload_index %}, int typeCheckedArgumentIndex{% endif %})
|
| {
|
| {% if constructor.is_named_constructor %}
|
| if (!info.IsConstructCall()) {
|
|
|