From 5ba858545a389c4d763bb6b446abf502fab03648 Mon Sep 17 00:00:00 2001 From: TopchetoEU <36534413+TopchetoEU@users.noreply.github.com> Date: Sat, 9 Mar 2024 00:28:30 +0200 Subject: [PATCH] fix: defer handles of async functions --- gradle.properties | 2 +- src/java/me/topchetoeu/jscript/lib/AsyncFunctionLib.java | 2 +- src/java/me/topchetoeu/jscript/lib/AsyncGeneratorLib.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0000fbf..2d27e7c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ project_group = me.topchetoeu project_name = jscript -project_version = 0.9.10-beta +project_version = 0.9.11-beta main_class = me.topchetoeu.jscript.utils.JScriptRepl diff --git a/src/java/me/topchetoeu/jscript/lib/AsyncFunctionLib.java b/src/java/me/topchetoeu/jscript/lib/AsyncFunctionLib.java index 48571a9..6b10d51 100644 --- a/src/java/me/topchetoeu/jscript/lib/AsyncFunctionLib.java +++ b/src/java/me/topchetoeu/jscript/lib/AsyncFunctionLib.java @@ -54,7 +54,7 @@ public class AsyncFunctionLib extends FunctionValue { public void onReject(EngineException err) { next(ctx, Values.NO_RETURN, err); } - }); + }.defer(ctx)); } } diff --git a/src/java/me/topchetoeu/jscript/lib/AsyncGeneratorLib.java b/src/java/me/topchetoeu/jscript/lib/AsyncGeneratorLib.java index d913edb..3096f51 100644 --- a/src/java/me/topchetoeu/jscript/lib/AsyncGeneratorLib.java +++ b/src/java/me/topchetoeu/jscript/lib/AsyncGeneratorLib.java @@ -62,7 +62,7 @@ public class AsyncGeneratorLib { @Override public void onReject(EngineException err) { next(ctx, Values.NO_RETURN, Values.NO_RETURN, err); } - }); + }.defer(ctx)); } else if (state == 2) { var obj = new ObjectValue();