Skip to content

Commit 60a3bdf

Browse files
committed
Fix for jsify + Closure
1 parent 9874c9f commit 60a3bdf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib/libaddfunction.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ addToLibrary({
5151
},
5252
#endif
5353
$wasmTypeCodes__internal: true,
54-
$wasmTypeCodes: {
54+
// Note: using template literal here instead of plain object
55+
// because jsify serializes objects w/o quotes and Closure will then
56+
// incorrectly mangle the properties.
57+
$wasmTypeCodes: `{
5558
'i': 0x7f, // i32
5659
#if MEMORY64
5760
'p': 0x7e, // i64
@@ -62,7 +65,7 @@ addToLibrary({
6265
'f': 0x7d, // f32
6366
'd': 0x7c, // f64
6467
'e': 0x6f, // externref
65-
},
68+
}`,
6669

6770
$generateTypePack__internal: true,
6871
$generateTypePack__deps: ['$uleb128EncodeWithLen', '$wasmTypeCodes'],

0 commit comments

Comments
 (0)