Skip to content

Commit 1e9838e

Browse files
authored
Fuzz shell: Add a j2wasm import (#6296)
With this, the fuzz shell can run a hello world Java file compiled by j2wasm.
1 parent 7e20a3b commit 1e9838e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/fuzz_shell.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,15 @@ var imports = {
174174
},
175175
};
176176

177+
// If Tags are available, add the import j2wasm expects.
178+
if (typeof WebAssembly.Tag !== 'undefined') {
179+
imports['imports'] = {
180+
'j2wasm.ExceptionUtils.tag': new WebAssembly.Tag({
181+
'parameters': ['externref']
182+
}),
183+
};
184+
}
185+
177186
imports = Asyncify.instrumentImports(imports);
178187

179188
// Create the wasm.

0 commit comments

Comments
 (0)