fix: promise defers callback twice
This commit is contained in:
parent
fbf103439a
commit
446ecd8f2b
@ -1,4 +1,4 @@
|
||||
project_group = me.topchetoeu
|
||||
project_name = jscript
|
||||
project_version = 0.9.9-beta
|
||||
project_version = 0.9.10-beta
|
||||
main_class = me.topchetoeu.jscript.utils.JScriptRepl
|
||||
|
@ -53,9 +53,6 @@ public class PromiseLib {
|
||||
private Object val;
|
||||
|
||||
private void resolveSynchronized(Context ctx, Object val, int newState) {
|
||||
if (!ctx.hasNotNull(EventLoop.KEY)) throw EngineException.ofError("No event loop");
|
||||
|
||||
ctx.get(EventLoop.KEY).pushMsg(() -> {
|
||||
this.val = val;
|
||||
this.state = newState;
|
||||
|
||||
@ -72,7 +69,13 @@ public class PromiseLib {
|
||||
}
|
||||
|
||||
handles = null;
|
||||
}, true);
|
||||
|
||||
// ctx.get(EventLoop.KEY).pushMsg(() -> {
|
||||
// if (!ctx.hasNotNull(EventLoop.KEY)) throw EngineException.ofError("No event loop");
|
||||
|
||||
|
||||
// handles = null;
|
||||
// }, true);
|
||||
|
||||
}
|
||||
private synchronized void resolve(Context ctx, Object val, int newState) {
|
||||
|
Loading…
Reference in New Issue
Block a user