scarpet corountines idea

This commit is contained in:
gnembon committed 2023-02-22 02:33:03 +01:00
1 parent 23ed35a398
commit 146573803c
11 files changed
+284 -17

No files matched your search

@@ -866,7 +866,7 @@ public class CarpetScriptHost extends ScriptHost
assertAppIntegrity(function.getModule());
Context context = new CarpetContext(this, source);
return function.getExpression().evalValue(
() -> function.execute(context, Context.VOID, function.getExpression(), function.getToken(), argv),
() -> function.execute(context, Context.VOID, function.getExpression(), function.getToken(), argv, null),
context,
Context.VOID
);
@@ -903,7 +903,7 @@ public class CarpetScriptHost extends ScriptHost
assertAppIntegrity(fun.getModule());
Context context = new CarpetContext(this, source, origin);
return fun.getExpression().evalValue(
() -> fun.execute(context, Context.VOID, fun.getExpression(), fun.getToken(), argv),
() -> fun.execute(context, Context.VOID, fun.getExpression(), fun.getToken(), argv, null),
context,
Context.VOID);
}
@@ -1215,4 +1215,10 @@ public class CarpetScriptHost extends ScriptHost
}
return false;
}
@Override
public boolean canSynchronouslyExecute()
{
return !scriptServer().server.isSameThread();
}
}