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 %} |