mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-26 19:45:54 +03:00
feat(enum): object.freeze the enum
This commit is contained in:
parent
79ef5979f4
commit
3ed363ae39
@ -1573,9 +1573,9 @@ impl<'a, 'b> SubContext<'a, 'b> {
|
|||||||
enum_string.push_str(&export);
|
enum_string.push_str(&export);
|
||||||
enum_string
|
enum_string
|
||||||
} else {
|
} else {
|
||||||
let mut enum_string = format!("export const {} = {{", enum_.name);
|
let mut enum_string = format!("export const {} = Object.freeze({{", enum_.name);
|
||||||
enum_string.push_str(&variants);
|
enum_string.push_str(&variants);
|
||||||
enum_string.push_str("}\n");
|
enum_string.push_str("})\n");
|
||||||
enum_string
|
enum_string
|
||||||
};
|
};
|
||||||
self.cx.globals.push_str(&global_export);
|
self.cx.globals.push_str(&global_export);
|
||||||
|
Loading…
Reference in New Issue
Block a user