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

Side by Side Diff: mojo/public/bindings/generators/js_templates/enum_definition.tmpl

Issue 99623010: Add support for enums within structs and interfaces to mojom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 {%- macro enum_def(enum_init, enum) %}
2 {{enum_init}} = {
3 {%- set next_value = 0 %}
4 {%- for field in enum.fields %}
5 {%- if field.value %}
6 {%- set next_value = field.value|int %}
7 {%- endif %}
8 {{field.name}}: {{next_value}},
9 {%- set next_value = next_value + 1 %}
10 {%- endfor %}
11 };
12 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698