summaryrefslogtreecommitdiff
path: root/scripts/fuzz_shell.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/fuzz_shell.js')
-rw-r--r--scripts/fuzz_shell.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/fuzz_shell.js b/scripts/fuzz_shell.js
index 3d29b197c..4cf3ba358 100644
--- a/scripts/fuzz_shell.js
+++ b/scripts/fuzz_shell.js
@@ -138,6 +138,7 @@ function logValue(x, y) {
var tempRet0;
var imports = {
'fuzzing-support': {
+ // Logging.
'log-i32': logValue,
'log-i64': logValue,
'log-f32': logValue,
@@ -147,7 +148,13 @@ var imports = {
// we could avoid running JS on code with SIMD in it, but it is useful to
// fuzz such code as much as we can.)
'log-v128': logValue,
+
+ // Throw an exception from JS.
+ 'throw': () => {
+ throw 'some JS error';
+ }
},
+ // Emscripten support.
'env': {
'setTempRet0': function(x) { tempRet0 = x },
'getTempRet0': function() { return tempRet0 },