diff --git a/src/tools/execution-results.h b/src/tools/execution-results.h index 0fd2781421c..ad4f5316cef 100644 --- a/src/tools/execution-results.h +++ b/src/tools/execution-results.h @@ -92,11 +92,12 @@ struct LoggingExternalInterface : public ShellExternalInterface { std::cout << "]\n"; return {}; } else if (import->base == "throw") { + // Throw something, depending on the value of the argument. 0 means we + // should throw a JS exception, and any other value means we should + // throw a wasm exception (with that value as the payload). if (arguments[0].geti32() == 0) { - // Throw in a way similar to JS. throwEmptyException(); } else { - // Throw the argument in the imported JS tag. auto payload = std::make_shared(fuzzTag, arguments); throwException(WasmException{Literal(payload)}); }