Skip to content

Commit 96f7ba8

Browse files
committed
refactor: use safer id for init func
1 parent aaac76a commit 96f7ba8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/WebAssemblyGenerator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function compose(...fns) {
1818

1919
// Utility functions
2020
const isGlobalImport = moduleImport => moduleImport.descr.type === "GlobalType";
21-
const initFuncId = t.identifier("__init__");
21+
const initFuncId = t.identifier("__webpack_init__");
2222

2323
/**
2424
* Removes the start instruction

lib/wasm/WasmModuleTemplatePlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class WasmModuleTemplatePlugin {
7272
'"use strict";',
7373
"// Instantiate WebAssembly module",
7474
"var instance = __webpack_require__.w[module.i]",
75-
`instance.exports.__init__(${initParams})`,
75+
`instance.exports.__webpack_init__(${initParams})`,
7676
"// export exports from WebAssembly module",
7777
// TODO rewrite this to getters depending on exports to support circular dependencies
7878
generateExports()

0 commit comments

Comments
 (0)