Index: Source/bindings/templates/methods.cpp |
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp |
index 106a30014ad8e38dca3b2b76e56705bfd5a22a66..d45d9ab1974094886a9467227929097646bf5bf6 100644 |
--- a/Source/bindings/templates/methods.cpp |
+++ b/Source/bindings/templates/methods.cpp |
@@ -37,7 +37,7 @@ static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const |
} |
{% endif %} |
{% for argument in method.arguments %} |
- {{generate_argument(method, argument) | indent}} |
+ {{generate_argument(method, argument, world_suffix) | indent}} |
{% endfor %} |
{% if world_suffix %} |
{{cpp_method_call(method, method.v8_set_return_value_for_main_world, method.cpp_value) | indent}} |
@@ -78,7 +78,7 @@ if (listener) { |
{######################################} |
-{% macro generate_argument(method, argument) %} |
+{% macro generate_argument(method, argument, world_suffix) %} |
{% if argument.is_optional and not argument.has_default and |
argument.idl_type != 'Dictionary' and |
not argument.is_callback_interface %} |
@@ -86,7 +86,11 @@ if (listener) { |
fewer arguments if they are omitted. |
Optional Dictionary arguments default to empty dictionary. #} |
if (UNLIKELY(info.Length() <= {{argument.index}})) { |
+ {% if world_suffix %} |
+ {{cpp_method_call(method, argument.v8_set_return_value_for_main_world, argument.cpp_value) | indent}} |
+ {% else %} |
{{cpp_method_call(method, argument.v8_set_return_value, argument.cpp_value) | indent}} |
+ {% endif %} |
return; |
} |
{% endif %} |