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

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

Issue 1410053006: Move third_party/mojo/src/mojo/public to mojo/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 1 month 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
OLDNEW
1 {%- macro enum_def(enum_name, enum) -%} 1 {%- macro enum_def(enum_name, enum) -%}
2 {{enum_name}} = {}; 2 {{enum_name}} = {};
3 {%- set prev_enum = 0 %} 3 {%- set prev_enum = 0 %}
4 {%- for field in enum.fields %} 4 {%- for field in enum.fields %}
5 {%- if field.value %} 5 {%- if field.value %}
6 {{enum_name}}.{{field.name}} = {{field.value|expression_to_text}}; 6 {{enum_name}}.{{field.name}} = {{field.value|expression_to_text}};
7 {%- elif loop.first %} 7 {%- elif loop.first %}
8 {{enum_name}}.{{field.name}} = 0; 8 {{enum_name}}.{{field.name}} = 0;
9 {%- else %} 9 {%- else %}
10 {{enum_name}}.{{field.name}} = {{enum_name}}.{{enum.fields[loop.index0 - 1].na me}} + 1; 10 {{enum_name}}.{{field.name}} = {{enum_name}}.{{enum.fields[loop.index0 - 1].na me}} + 1;
11 {%- endif %} 11 {%- endif %}
12 {%- endfor %} 12 {%- endfor %}
13 {%- endmacro %} 13 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698