From a333277566f78da7796679821bb080fd54614fa9 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 6 Feb 2025 16:02:29 -0800 Subject: [PATCH] clarify the expected behavior --- src/tools/execution-results.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)}); }