From 473dd9c6a47a519fbb2161e3102e706a05e34b20 Mon Sep 17 00:00:00 2001 From: Yuri Iozzelli Date: Fri, 1 Aug 2025 16:11:20 +0200 Subject: [PATCH] cannot catch JSException in wasm functions --- tests/unit/exceptions/exitexception1.cpp | 2 ++ tests/unit/exceptions/exitexception2.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/unit/exceptions/exitexception1.cpp b/tests/unit/exceptions/exitexception1.cpp index 4520653..76a0767 100644 --- a/tests/unit/exceptions/exitexception1.cpp +++ b/tests/unit/exceptions/exitexception1.cpp @@ -9,8 +9,10 @@ int main() { if (i == 1) exit(0); +#ifndef __ASMJS__ } catch(cheerp::JSException& e) { cheerp::console_log("JSException clause ignores exit-exception : FAILURE"); +#endif } catch(...) { cheerp::console_log("Catch-all clause ignores exit-exception : FAILURE"); } diff --git a/tests/unit/exceptions/exitexception2.cpp b/tests/unit/exceptions/exitexception2.cpp index d012915..66bf940 100644 --- a/tests/unit/exceptions/exitexception2.cpp +++ b/tests/unit/exceptions/exitexception2.cpp @@ -9,8 +9,10 @@ int main() { if (i == 1) exit(1); +#ifndef __ASMJS__ } catch(cheerp::JSException& e) { cheerp::console_log("JSException clause ignores exit-exception : FAILURE"); +#endif } catch(...) { cheerp::console_log("Catch-all clause ignores exit-exception : FAILURE"); }