Skip to content

Commit af78d48

Browse files
committed
Remove redundant check if ScriptEngine is closed.
1 parent b8e128e commit af78d48

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

graal-js/src/com.oracle.truffle.js.scriptengine/src/com/oracle/truffle/js/scriptengine/GraalJSScriptEngine.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ public Builder setOption(Builder builder, Object value) {
239239
private final GraalJSEngineFactory factory;
240240
private final Context.Builder contextConfig;
241241

242-
private volatile boolean closed;
243242
private boolean evalCalled;
244243

245244
GraalJSScriptEngine(GraalJSEngineFactory factory) {
@@ -292,7 +291,6 @@ static Context createDefaultContext(Context.Builder builder) {
292291
@Override
293292
public void close() {
294293
getPolyglotContext().close();
295-
closed = true;
296294
}
297295

298296
/**
@@ -532,18 +530,12 @@ private static <T> T getInterfaceInner(Value thiz, Class<T> iface) {
532530

533531
@Override
534532
public CompiledScript compile(String script) throws ScriptException {
535-
if (closed) {
536-
throw new IllegalStateException("Context already closed.");
537-
}
538533
Source source = createSource(script, getContext());
539534
return compile(source);
540535
}
541536

542537
@Override
543538
public CompiledScript compile(Reader reader) throws ScriptException {
544-
if (closed) {
545-
throw new IllegalStateException("Context already closed.");
546-
}
547539
Source source = createSource(read(reader), getContext());
548540
return compile(source);
549541
}

0 commit comments

Comments
 (0)