From 7b28266f4d140f7705a49dad4cc0aa8fed7ddcce Mon Sep 17 00:00:00 2001 From: theMackabu Date: Tue, 30 Dec 2025 15:35:07 -0800 Subject: [PATCH] add thrown value to js_try function --- meson.build | 2 +- src/ant.c | 2 ++ tests/window.cjs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 4c0339d..333b98a 100644 --- a/meson.build +++ b/meson.build @@ -79,7 +79,7 @@ endif build_date = run_command('date', '+%Y-%m-%d', check: true).stdout().strip() version_conf = configuration_data() -version_conf.set('ANT_VERSION', '0.2.2.11') +version_conf.set('ANT_VERSION', '0.2.2.12') version_conf.set('ANT_GIT_HASH', git_hash) version_conf.set('ANT_BUILD_DATE', build_date) diff --git a/src/ant.c b/src/ant.c index f680997..f71e89b 100644 --- a/src/ant.c +++ b/src/ant.c @@ -10086,6 +10086,7 @@ static jsval_t js_try(struct js *js) { } else if (had_exception && !exception_handled) { js->flags |= F_THROW; strncpy(js->errmsg, saved_errmsg, sizeof(js->errmsg) - 1); + js->thrown_value = exception_value; } else if (catch_returned) { js->flags |= F_RETURN; res = catch_return_value; @@ -10097,6 +10098,7 @@ static jsval_t js_try(struct js *js) { } else if (had_exception && !exception_handled) { js->flags |= F_THROW; strncpy(js->errmsg, saved_errmsg, sizeof(js->errmsg) - 1); + js->thrown_value = exception_value; res = mkval(T_ERR, 0); } else if (catch_returned) { js->flags |= F_RETURN; diff --git a/tests/window.cjs b/tests/window.cjs index 8e47a4c..4df626a 100644 --- a/tests/window.cjs +++ b/tests/window.cjs @@ -1,2 +1,2 @@ -const window = this; +const window = 5; console.log(window); -- 2.51.2