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

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

Issue 469373002: Bindings generation emits (more) correct null checking (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/dartium
Patch Set: Adding in fixes to binding generation Created 6 years, 4 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_attributes.py ('k') | Source/bindings/dart/scripts/dart_methods.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/dart/scripts/dart_interface.py
diff --git a/Source/bindings/dart/scripts/dart_interface.py b/Source/bindings/dart/scripts/dart_interface.py
index 3690874396741d286e12f34f4f345691c3dba4c2..c647e4cb13beec3666caf7b33e7ff5070e45de12 100644
--- a/Source/bindings/dart/scripts/dart_interface.py
+++ b/Source/bindings/dart/scripts/dart_interface.py
@@ -837,7 +837,7 @@ def generate_constructor(interface, constructor):
return {
'argument_list': constructor_argument_list(interface, constructor),
# TODO(terry): Use dart_methods.generate_argument instead constructor_argument.
- 'arguments': [constructor_argument(argument, index)
+ 'arguments': [constructor_argument(interface, argument, index)
for index, argument in enumerate(constructor.arguments)],
'has_exception_state':
# [RaisesException=Constructor]
@@ -885,7 +885,7 @@ def constructor_argument_list(interface, constructor):
# TODO(terry): Eliminate this function use dart_methods.generate_argument instead
# for all constructor arguments.
-def constructor_argument(argument, index):
+def constructor_argument(interface, argument, index):
idl_type = argument.idl_type
default_value = str(argument.default_value) if argument.default_value else None
@@ -905,7 +905,7 @@ def constructor_argument(argument, index):
'is_optional': argument.is_optional,
'is_strict_type_checking': False, # Required for overload resolution
'name': argument.name,
- 'dart_value_to_local_cpp_value': dart_methods.dart_value_to_local_cpp_value(argument, index),
+ 'dart_value_to_local_cpp_value': dart_methods.dart_value_to_local_cpp_value(interface, argument, index),
}
return argument_content
@@ -1006,9 +1006,10 @@ def property_getter(getter, cpp_arguments):
release=idl_type.release)}
-def property_setter(setter):
+def property_setter(interface, setter):
idl_type = setter.arguments[1].idl_type
extended_attributes = setter.extended_attributes
+ interface_extended_attributes = interface.extended_attributes
is_raises_exception = 'RaisesException' in extended_attributes
return {
'has_strict_type_checking':
@@ -1021,7 +1022,7 @@ def property_setter(setter):
'is_raises_exception': is_raises_exception,
'name': DartUtilities.cpp_name(setter),
'dart_value_to_local_cpp_value': idl_type.dart_value_to_local_cpp_value(
- extended_attributes, 'propertyValue', False),
+ interface_extended_attributes, extended_attributes, 'propertyValue', False),
}
@@ -1075,7 +1076,7 @@ def indexed_property_setter(interface):
except StopIteration:
return None
- return property_setter(setter)
+ return property_setter(interface, setter)
def indexed_property_deleter(interface):
@@ -1129,7 +1130,7 @@ def named_property_setter(interface):
except StopIteration:
return None
- return property_setter(setter)
+ return property_setter(interface, setter)
def named_property_deleter(interface):
« no previous file with comments | « Source/bindings/dart/scripts/dart_attributes.py ('k') | Source/bindings/dart/scripts/dart_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698