Skip to content

Commit

Permalink
Polyfill seems not to work very well in sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
mxro committed Dec 24, 2024
1 parent 6fbfa77 commit e1d9bb3
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 1,089 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,33 +112,6 @@ public NashornSandboxImpl(ScriptEngine engine, String... params) {
this.allow(InterruptTest.class);
this.engineAsserted = new AtomicBoolean(false);

// for (String param : params) {
// if (param.equals("--language=es6")) {
// this.allow(java.util.Timer.class);
// try (final BufferedReader reader = new BufferedReader(new InputStreamReader(
// new BufferedInputStream(JsSanitizer.class.getResourceAsStream("resources/es6/nashorn-ext-for-es6.js")),
// StandardCharsets.UTF_8))) {
// final StringBuilder sb = new StringBuilder();
// String line;
// while ((line = reader.readLine()) != null) {
// sb.append(line).append('\n');
// }
// final String script = sb.toString();
// try {
// this.allowGlobalsObjects(true);
// this.allowLoadFunctions(true);
// this.allowGlobalsObjects(true);
// this.scriptEngine.eval(script+"\nArray.from(1,2,3);");
// } catch (ScriptCPUAbuseException e) {
// throw new RuntimeException("CPU usage exceeded from loading Nashorn ES6 extension..");
// } catch (ScriptException e) {
// throw new RuntimeException("Script error while loading Nashorn ES6 extension.", e);
// }
// } catch (final IOException e) {
// throw new RuntimeException("Cannot find file: resources/es6/nashorn-ext-for-es6.js", e);
// }
// }
// }
}

private SandboxClassFilter createSandboxClassFilter() {
Expand Down

This file was deleted.

Loading

0 comments on commit e1d9bb3

Please sign in to comment.