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

Unified Diff: mojo/public/bindings/generators/cpp_templates/struct_builder_definition.tmpl

Issue 164873002: Fix bug with using enums as default values in mojom. We were previously (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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: mojo/public/bindings/generators/cpp_templates/struct_builder_definition.tmpl
diff --git a/mojo/public/bindings/generators/cpp_templates/struct_builder_definition.tmpl b/mojo/public/bindings/generators/cpp_templates/struct_builder_definition.tmpl
index 86f4c21c9ef38a88787b10a05a1cd6015874b55c..ea9c0e9b2c5f53cbceca38258bea1c0e81dba1b1 100644
--- a/mojo/public/bindings/generators/cpp_templates/struct_builder_definition.tmpl
+++ b/mojo/public/bindings/generators/cpp_templates/struct_builder_definition.tmpl
@@ -9,7 +9,7 @@
{%- macro set_default(kind, value, depth) -%}
{#--- Strings ---#}
{%- if kind|is_string_kind -%}
-{{caller("mojo::String(" ~ value ~ ")")}}
+{{caller("mojo::String(" ~ value|expression_to_text(module) ~ ")")}}
{#--- Arrays ---#}
{%- elif kind|is_array_kind %}
{%- set _ = value|verify_token_type("ARRAY") %}
@@ -43,7 +43,7 @@ tmp{{depth}}.set_{{subfield.name}}({{result}});
}
{#--- POD types ---#}
{%- else -%}
-{{caller(value|substitute_namespace(imports))}}
+{{caller(value|expression_to_text(module))}}
{%- endif %}
{%- endmacro %}

Powered by Google App Engine
This is Rietveld 408576698