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

Unified Diff: mojo/public/bindings/generators/js_templates/struct_definition.tmpl

Issue 159983003: Fix a bug with mojom imports where 2 imports with the same namespace would (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/js_templates/struct_definition.tmpl
diff --git a/mojo/public/bindings/generators/js_templates/struct_definition.tmpl b/mojo/public/bindings/generators/js_templates/struct_definition.tmpl
index df1ad15de450fdfcb98134d1a181ff9438eb6e91..3c836dda795415c499a53bf86bb738f1eb6274ed 100644
--- a/mojo/public/bindings/generators/js_templates/struct_definition.tmpl
+++ b/mojo/public/bindings/generators/js_templates/struct_definition.tmpl
@@ -1,7 +1,7 @@
{%- macro set_default(kind, value, depth) -%}
{#--- Strings ---#}
{%- if kind|is_string_kind -%}
-{{caller(value)}}
+{{caller(value|substitute_namespace(imports))}}
{#--- Arrays ---#}
{%- elif kind|is_array_kind %}
{%- set _ = value|verify_token_type("ARRAY") %}
@@ -20,7 +20,7 @@ tmp{{depth}}[{{loop.index0}}] = {{result}};
{%- elif kind|is_object_kind %}
{%- set _ = value|verify_token_type("OBJECT") %}
{
- var tmp{{depth}} = new {{kind|js_type}}();
+ var tmp{{depth}} = new {{kind|js_type(imports)}}();
{%- set struct = kinds[kind.spec] %}
{%- for element in value[1] %}
{#- Use struct.packed_fields to order struct values by ordinal number #}
@@ -35,7 +35,7 @@ tmp{{depth}}.{{subfield.name}} = {{result}};
}
{#--- POD types ---#}
{%- else -%}
-{{caller(value)}}
+{{caller(value|substitute_namespace(imports))}}
{%- endif %}
{%- endmacro %}

Powered by Google App Engine
This is Rietveld 408576698