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

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

Issue 936193005: Make it possible to inherit from any constructable host object (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Remove extra comment 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
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 a69850a21a66f233f971ecf86e4a04faf2857b76..a06f93c997ebd608521560bf9b121989b755a851 100644
--- a/sky/engine/bindings/scripts/templates/interface_dart.template
+++ b/sky/engine/bindings/scripts/templates/interface_dart.template
@@ -19,16 +19,17 @@ part of sky.core;
{%- endfor -%}
{%- endmacro -%}
-abstract class {{interface_name}} extends {{ parent_interface if parent_interface else 'NativeFieldWrapperClass2' }} {
+{% if not constructors %}abstract {% endif -%}
+class {{interface_name}} extends {{ parent_interface if parent_interface else 'NativeFieldWrapperClass2' }} {
// Constructors
{# TODO(eseidel): We only ever have one constructor. #}
-{%- for constructor in constructors -%}
- static {{interface_name}} _constructor({{ args_macro(constructor.arguments) }}) native "{{interface_name}}_constructorCallback";
- factory {{interface_name}}({{ args_macro(constructor.arguments) }}) => _constructor(
+{%- for constructor in constructors %}
+ void _constructor({{ args_macro(constructor.arguments) }}) native "{{interface_name}}_constructorCallback";
+ {{interface_name}}({{ args_macro(constructor.arguments) }}) { _constructor(
{%- for arg in constructor.arguments -%}
{{ arg.name }}{% if not loop.last %}, {% endif %}
{%- endfor -%}
- );
+ ); }
{% endfor %}
// Attributes

Powered by Google App Engine
This is Rietveld 408576698