Commit 86e68fc6 authored by Darren Shen's avatar Darren Shen Committed by Commit Bot

Use @export for struct field definitions in Mojo lite bindings.

The fields defined on a Mojo lite struct should not be renamed, as
they are expected verbatim by the Mojo struct encoder.

However, if compiled with property_renaming=ALL_UNQUOTED, the current
generated struct fields will be renamed, which breaks the encoder.

Use @export to prevent these fields from being renamed.

Bug: 1132645
Change-Id: I0f4678c5ebf7d54ddd53c75eb3e7f0a4db94a0f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2432235
Auto-Submit: Darren Shen <shend@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811507}
parent f7afb83b
...@@ -45,7 +45,7 @@ goog.provide('{{module.namespace}}.{{struct.name}}'); ...@@ -45,7 +45,7 @@ goog.provide('{{module.namespace}}.{{struct.name}}');
{{module.namespace}}.{{struct.name}} = class { {{module.namespace}}.{{struct.name}} = class {
constructor() { constructor() {
{%- for packed_field in struct.packed.packed_fields %} {%- for packed_field in struct.packed.packed_fields %}
/** @type { {{packed_field.field.kind|lite_closure_field_type}} } */ /** @export { {{packed_field.field.kind|lite_closure_field_type}} } */
this.{{packed_field.field.name}}; this.{{packed_field.field.name}};
{%- endfor %} {%- endfor %}
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment