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

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

Issue 231833005: Refactor v8_types.v8_value_to_local_cpp_value for clarity and to make Promises easier to implement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Naming Created 6 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_types.py
diff --git a/Source/bindings/scripts/v8_types.py b/Source/bindings/scripts/v8_types.py
index a17c73ecfb1c70996d2cd76f0371f17b407a3461..862b2a04d8388a46a10c8a114f20c6b16f3ea2f8 100644
--- a/Source/bindings/scripts/v8_types.py
+++ b/Source/bindings/scripts/v8_types.py
@@ -417,15 +417,17 @@ def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variabl
this_cpp_type = idl_type.cpp_type_args(extended_attributes=extended_attributes, used_as_argument=True)
idl_type = idl_type.preprocessed_type
+ cpp_value = v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index)
+ args = [this_cpp_type, variable_name, cpp_value]
if idl_type.base_type == 'DOMString' and not idl_type.array_or_sequence_type:
- format_string = 'V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID({cpp_type}, {variable_name}, {cpp_value})'
+ v8trycatch_void = 'V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID'
elif idl_type.is_integer_type:
- format_string = 'V8TRYCATCH_EXCEPTION_VOID({cpp_type}, {variable_name}, {cpp_value}, exceptionState)'
+ v8trycatch_void = 'V8TRYCATCH_EXCEPTION_VOID'
+ args.append('exceptionState')
else:
- format_string = 'V8TRYCATCH_VOID({cpp_type}, {variable_name}, {cpp_value})'
+ v8trycatch_void = 'V8TRYCATCH_VOID'
- cpp_value = v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, index)
- return format_string.format(cpp_type=this_cpp_type, cpp_value=cpp_value, variable_name=variable_name)
+ return '%s(%s)' % (v8trycatch_void, ', '.join(args))
IdlType.v8_value_to_local_cpp_value = v8_value_to_local_cpp_value
IdlUnionType.v8_value_to_local_cpp_value = v8_value_to_local_cpp_value
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698