src/jdk/nashorn/tools/Shell.java

Print this page
rev 1240 : 8074410: Startup time: Port shell.js to Java
Reviewed-by: lagergren, hannesw

*** 415,436 **** try { if (globalChanged) { Context.setGlobal(global); } ! // initialize with "shell.js" script ! try { ! final Source source = sourceFor("<shell.js>", Shell.class.getResource("resources/shell.js")); ! context.eval(global, source.getString(), global, "<shell.js>", false); ! } catch (final Exception e) { ! err.println(e); ! if (env._dump_on_error) { ! e.printStackTrace(err); ! } ! ! return INTERNAL_ERROR; ! } while (true) { err.print(prompt); err.flush(); --- 415,425 ---- try { if (globalChanged) { Context.setGlobal(global); } ! global.addShellBuiltins(); while (true) { err.print(prompt); err.flush();