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

Unified Diff: mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl

Issue 268363003: Mojo: Add support for constants to the IDL compiler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: JS export constants Created 6 years, 7 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: mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
diff --git a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
index a211456be7fff8b2b2efc8294ffe9d531efc663a..8b225723f75d21ceffdf53ff0d4aad94517ac20d 100644
--- a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
@@ -109,3 +109,9 @@ params.{{parameter.name}}{% if not loop.last %}, {% endif -%}
{{enum_def("%sProxy.%s"|format(interface.name, enum.name), enum, module)}}
{{interface.name}}Stub.{{enum.name}} = {{interface.name}}Proxy.{{enum.name}};
{%- endfor %}
+
+{#--- Constants. #}
+{% for constant in interface.constants %}
+ {{interface.name}}Proxy.{{constant.name}} = {{constant.value|expression_to_text(module)}};
+ {{interface.name}}Stub.{{constant.name}} = {{interface.name}}Proxy.{{constant.name}};
+{% endfor %}

Powered by Google App Engine
This is Rietveld 408576698