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

Unified Diff: Source/bindings/dart/scripts/dart_methods.py

Issue 906343002: Added enum checks since enums are now supported in the IDL (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/dartium
Patch Set: Created 5 years, 10 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/dart/scripts/dart_dictionary.py ('k') | Source/bindings/dart/scripts/dart_types.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/dart/scripts/dart_methods.py
diff --git a/Source/bindings/dart/scripts/dart_methods.py b/Source/bindings/dart/scripts/dart_methods.py
index eb4b14e27af12d150460a69acdbaa0ace5d2a3ca..b700e8939fef3e25b888a9fe202b92da7939a4f0 100644
--- a/Source/bindings/dart/scripts/dart_methods.py
+++ b/Source/bindings/dart/scripts/dart_methods.py
@@ -130,6 +130,10 @@ def argument_context(interface, method, argument, index):
preprocessed_type = 'float'
if preprocessed_type == 'unrestricted double':
preprocessed_type = 'double'
+
+ dart_enum_expression = idl_type.enum_validation_expression
+ if dart_enum_expression:
+ dart_enum_expression = dart_enum_expression.format(param_name=argument.name)
context.update({
'cpp_type': idl_type.cpp_type_args(extended_attributes=extended_attributes,
raw_type=True,
@@ -138,7 +142,7 @@ def argument_context(interface, method, argument, index):
'local_cpp_type': local_cpp_type,
# FIXME: check that the default value's type is compatible with the argument's
'default_value': default_value,
- 'enum_validation_expression': idl_type.enum_validation_expression,
+ 'enum_validation_expression': dart_enum_expression,
'preprocessed_type': preprocessed_type,
'is_array_or_sequence_type': not not idl_type.native_array_element_type,
'is_strict_type_checking': 'DartStrictTypeChecking' in extended_attributes,
« no previous file with comments | « Source/bindings/dart/scripts/dart_dictionary.py ('k') | Source/bindings/dart/scripts/dart_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698