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

Unified Diff: sky/engine/bindings/scripts/templates/interface_dart.template

Issue 938003004: Make it possible to create reasonable subclasses of Event (Closed) Base URL: git@github.com:domokit/mojo.git@master
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 | « no previous file | sky/engine/core/events/Event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/bindings/scripts/templates/interface_dart.template
diff --git a/sky/engine/bindings/scripts/templates/interface_dart.template b/sky/engine/bindings/scripts/templates/interface_dart.template
index b4c66a245f20fb71eebbda97fd10615a831e2242..3ec63ac3c89cff72fdd05738edf56110b99dbcb4 100644
--- a/sky/engine/bindings/scripts/templates/interface_dart.template
+++ b/sky/engine/bindings/scripts/templates/interface_dart.template
@@ -11,7 +11,7 @@ part of sky.core;
{{ '{' if arg.is_named else '[' }}
{%- endif -%}
{{ arg.dart_type }} {{ arg.name }}
- {%- if arg.is_optional %} {{ ':' if arg.is_named else '='}} {{ arg.dart_default_value }}
+ {%- if arg.is_optional %} {{ ':' if arg.is_named else '='}} {{ arg.dart_default_value }}
{#- TODO(eseidel): This does not support having both optional and named arguments! -#}
{%- if loop.last -%}{{ '}' if arg.is_named else ']' }}{%- endif -%}
{%- endif -%}
@@ -24,7 +24,11 @@ class {{interface_name}} extends {{ parent_interface if parent_interface else 'N
// Constructors
{# TODO(eseidel): We only ever have one constructor. #}
{%- for constructor in constructors %}
- void _constructor({{ args_macro(constructor.arguments) }}) native "{{interface_name}}_constructorCallback";
+ void _constructor(
+ {%- for arg in constructor.arguments -%}
+ {{ arg.dart_type }} {{ arg.name }}{% if not loop.last %}, {% endif %}
+ {%- endfor -%}
+ ) native "{{interface_name}}_constructorCallback";
{{interface_name}}({{ args_macro(constructor.arguments) }}) { _constructor(
{%- for arg in constructor.arguments -%}
{{ arg.name }}{% if not loop.last %}, {% endif %}
« no previous file with comments | « no previous file | sky/engine/core/events/Event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698