Index: Source/bindings/scripts/v8_methods.py |
diff --git a/Source/bindings/scripts/v8_methods.py b/Source/bindings/scripts/v8_methods.py |
index 94f22f33814e7d2d9871f4d72c35767929293390..f373ebb1b2ca0ecbb23690e9d41cca953b3bfc86 100644 |
--- a/Source/bindings/scripts/v8_methods.py |
+++ b/Source/bindings/scripts/v8_methods.py |
@@ -173,6 +173,7 @@ def generate_argument(interface, method, argument, index): |
'v8_set_return_value_for_main_world': v8_set_return_value(interface.name, method, this_cpp_value, for_main_world=True), |
'v8_set_return_value': v8_set_return_value(interface.name, method, this_cpp_value), |
'v8_value_to_local_cpp_value': v8_value_to_local_cpp_value(argument, index), |
+ 'v8_value_to_local_cpp_value_async': v8_value_to_local_cpp_value_async(argument, index), |
} |
@@ -262,6 +263,25 @@ def v8_value_to_local_cpp_value(argument, index): |
name, index=index) |
+def v8_value_to_local_cpp_value_async(argument, index): |
Nils Barth (inactive)
2014/04/11 10:26:39
Could you merge this with above, only adding an as
yhirano
2014/04/11 10:54:22
Done. I split the variadic case to another functio
|
+ extended_attributes = argument.extended_attributes |
+ idl_type = argument.idl_type |
+ name = argument.name |
+ if argument.is_variadic: |
+ vector_type = v8_types.cpp_ptr_type('Vector', 'HeapVector', idl_type.gc_type) |
+ return 'TONATIVE_VOID_ASYNC({vector_type}<{cpp_type}>, {name}, toNativeArguments<{cpp_type}>(info, {index}), info)'.format( |
+ vector_type=vector_type, cpp_type=idl_type.cpp_type, name=name, |
+ index=index) |
+ # [Default=NullString] |
+ if (argument.is_optional and idl_type.name == 'String' and |
+ extended_attributes.get('Default') == 'NullString'): |
+ v8_value = 'argumentOrNull(info, %s)' % index |
+ else: |
+ v8_value = 'info[%s]' % index |
+ return idl_type.v8_value_to_local_cpp_value(extended_attributes, v8_value, |
+ name, index=index, async=True) |
+ |
+ |
################################################################################ |
# Auxiliary functions |
################################################################################ |