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

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

Issue 386963003: [WIP][NotForLand] IDL dictionary support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: sequence and array support Created 6 years, 5 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 | « Source/bindings/scripts/v8_dictionary.py ('k') | Source/bindings/scripts/v8_types.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_methods.py
diff --git a/Source/bindings/scripts/v8_methods.py b/Source/bindings/scripts/v8_methods.py
index cdc5d9be1b015f06923f83bd09a6df19f0d2627d..f098935e472268b19b4a8ecdc7012fb7bccf6aa2 100644
--- a/Source/bindings/scripts/v8_methods.py
+++ b/Source/bindings/scripts/v8_methods.py
@@ -200,17 +200,18 @@ def argument_context(interface, method, argument, index):
not idl_type.is_basic_type):
raise Exception('Private scripts supports only primitive types and DOM wrappers.')
+ default_value = argument.default_cpp_value
return {
'cpp_type': idl_type.cpp_type_args(extended_attributes=extended_attributes,
raw_type=True,
used_as_variadic_argument=argument.is_variadic),
'cpp_value': this_cpp_value,
# FIXME: check that the default value's type is compatible with the argument's
- 'default_value': argument.default_cpp_value,
+ 'default_value': default_value,
'enum_validation_expression': idl_type.enum_validation_expression,
'handle': '%sHandle' % argument.name,
# FIXME: remove once [Default] removed and just use argument.default_value
- 'has_default': 'Default' in extended_attributes or argument.default_value,
+ 'has_default': 'Default' in extended_attributes or default_value,
'has_type_checking_interface':
(has_extended_attribute_value(interface, 'TypeChecking', 'Interface') or
has_extended_attribute_value(method, 'TypeChecking', 'Interface')) and
@@ -386,6 +387,9 @@ def union_arguments(idl_type):
def argument_default_cpp_value(argument):
+ if argument.idl_type.is_dictionary:
+ # Dictionaries always have a default value
+ return '%s::create()' % argument.idl_type.base_type
if not argument.default_value:
return None
return argument.idl_type.literal_cpp_value(argument.default_value)
« no previous file with comments | « Source/bindings/scripts/v8_dictionary.py ('k') | Source/bindings/scripts/v8_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698