Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

Commit b66acd3

Browse files
committed
fix: several more fixes
1 parent e326847 commit b66acd3

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/me/topchetoeu/jscript/Main.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,13 @@ false, new Context(engine).pushEnv(tsEnv),
100100
Reading.resourceToString("js/ts.js"), null
101101
).await();
102102
System.out.println("Loaded typescript!");
103+
104+
var ctx = new Context(engine).pushEnv(env.child());
105+
103106
engine.pushMsg(
104-
false, new Context(engine).pushEnv(env.child()),
107+
false, ctx,
105108
new Filename("jscript", "internals/bootstrap.js"), Reading.resourceToString("js/bootstrap.js"), null,
106-
tsEnv.global.obj, env, new ArrayValue(null, Reading.resourceToString("js/lib.d.ts"))
109+
tsEnv.global.get(ctx, "ts"), env, new ArrayValue(null, Reading.resourceToString("js/lib.d.ts"))
107110
).await();
108111
}
109112
catch (EngineException e) {

src/me/topchetoeu/jscript/interop/OverloadFunction.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import me.topchetoeu.jscript.engine.values.Values;
1212
import me.topchetoeu.jscript.exceptions.ConvertException;
1313
import me.topchetoeu.jscript.exceptions.EngineException;
14+
import me.topchetoeu.jscript.exceptions.InterruptException;
1415

1516
public class OverloadFunction extends FunctionValue {
1617
public final List<Overload> overloads = new ArrayList<>();
@@ -87,6 +88,9 @@ else if (e.getTargetException() instanceof NullPointerException) {
8788
e.printStackTrace();
8889
throw EngineException.ofType("Unexpected value of 'undefined'.").add(name, loc);
8990
}
91+
else if (e.getTargetException() instanceof InterruptException || e.getTargetException() instanceof InterruptedException) {
92+
throw new InterruptException();
93+
}
9094
else {
9195
throw EngineException.ofError(e.getTargetException().getMessage()).add(name, loc);
9296
}

0 commit comments

Comments
 (0)