Permissions and filesystems #9

Merged
TopchetoEU merged 36 commits from TopchetoEU/perms-and-fs into master 2023-11-25 18:10:59 +00:00
Showing only changes of commit 443dc0ffa1 - Show all commits

View File

@ -347,4 +347,19 @@ import me.topchetoeu.jscript.interop.Native;
public PromiseLib() {
this(STATE_PENDING, null);
}
public static PromiseLib await(Context ctx, PromiseRunner runner) {
var res = new PromiseLib();
new Thread(() -> {
try {
res.fulfill(ctx, runner.run());
}
catch (EngineException e) {
res.reject(ctx, e.value);
}
}, "Promisifier").start();
return res;
}
}