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

Unified Diff: sky/engine/bindings/scripts/dart_interface.py

Issue 942553002: Make element.style["color"] work in Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Add back removeProperty 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 | « no previous file | sky/engine/bindings/scripts/templates/interface_base_cpp.template » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/bindings/scripts/dart_interface.py
diff --git a/sky/engine/bindings/scripts/dart_interface.py b/sky/engine/bindings/scripts/dart_interface.py
index 0b0223fa7167097ecc76d4ef6461c4a3fc5289aa..f600b584ce9a5b05cf99e4b525478b99d5031c94 100644
--- a/sky/engine/bindings/scripts/dart_interface.py
+++ b/sky/engine/bindings/scripts/dart_interface.py
@@ -626,18 +626,24 @@ def property_getter(getter, cpp_arguments):
return context
-def property_setter(setter):
+def property_setter(setter, cpp_arguments):
context = v8_interface.property_setter(setter)
- idl_type = setter.arguments[1].idl_type
+ idl_type = setter.idl_type
extended_attributes = setter.extended_attributes
+ is_raises_exception = 'RaisesException' in extended_attributes
- context.update({
- 'dart_value_to_local_cpp_value': idl_type.dart_value_to_local_cpp_value(
- extended_attributes, 'propertyValue', False,
- context['has_type_checking_interface']),
- })
+ cpp_method_name = 'receiver->%s' % DartUtilities.cpp_name(setter)
+
+ if is_raises_exception:
+ cpp_arguments.append('es')
+ cpp_value = '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments))
+ context.update({
+ 'cpp_type': idl_type.cpp_type,
+ 'cpp_value': cpp_value,
+ 'is_raises_exception': is_raises_exception,
+ 'name': DartUtilities.cpp_name(setter)})
return context
@@ -700,7 +706,7 @@ def named_property_getter(interface):
getter.name = getter.name or 'anonymousNamedGetter'
- return property_getter(getter, ['propertyName'])
+ return property_getter(getter, [getter.arguments[0].name])
def named_property_setter(interface):
@@ -716,7 +722,8 @@ def named_property_setter(interface):
except StopIteration:
return None
- return property_setter(setter)
+ return property_setter(setter, [setter.arguments[0].name,
+ setter.arguments[1].name])
def generate_native_entries_for_specials(interface, context):
« no previous file with comments | « no previous file | sky/engine/bindings/scripts/templates/interface_base_cpp.template » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698