1
0
mirror of https://github.com/fluencelabs/wasm-bindgen synced 2025-04-03 10:51:09 +00:00

feat(enum): object.freeze the enum

This commit is contained in:
Ashley Williams 2018-03-29 17:28:42 +02:00
parent 79ef5979f4
commit 3ed363ae39

@ -1573,9 +1573,9 @@ impl<'a, 'b> SubContext<'a, 'b> {
enum_string.push_str(&export);
enum_string
} 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("}\n");
enum_string.push_str("})\n");
enum_string
};
self.cx.globals.push_str(&global_export);