Skip to content

Commit b137251

Browse files
committed
lint fix
1 parent 1fcf4fb commit b137251

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/core/execute.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ function nodeExecutor(wasms: string[], outFolder: string, imports: Imports) {
3737
if (imp.kind === "function") {
3838
const moduleName = imp.module;
3939
const funcName = imp.name;
40-
if (!importObject[moduleName]) {
41-
importObject[moduleName] = {};
42-
}
43-
if (!importObject[moduleName][funcName]) {
40+
if (!importObject[moduleName]?.[funcName]) {
41+
if (!importObject[moduleName]) {
42+
importObject[moduleName] = {};
43+
}
4444
// eslint-disable-next-line @typescript-eslint/no-explicit-any
45-
importObject[moduleName][funcName] = (...args: any[]): any => {
45+
(importObject[moduleName] as any)[funcName] = (...args: any[]): any => {
46+
// notify that a default function has been called
4647
console.log(`Default stub called for ${moduleName}.${funcName}, args:`, args);
4748
return 0;
4849
};

0 commit comments

Comments
 (0)