MCPcopy Create free account
hub / github.com/dynjs/dynjs / execute

Method execute

src/main/java/org/dynjs/cli/Repl.java:89–114  ·  view source on GitHub ↗
(ConsoleOperation output)

Source from the content-addressed store, hash-verified

87 console.setPrompt(new Prompt(prompt));
88 console.setConsoleCallback(new AeshConsoleCallback() {
89 @Override
90 public int execute(ConsoleOperation output) {
91 String statement = output.getBuffer();
92 log.write(statement + "\n");
93 if (statement.equalsIgnoreCase("exit")) {
94 console.stop();
95 return 0;
96 } else {
97 try {
98 Object object = runtime.evaluate(statement);
99 log.write(object.toString() + "\n");
100 console.getShell().out().println(object.toString());
101 } catch (DynJSException e) {
102 console.getShell().out().println(e.getLocalizedMessage());
103 logException(e);
104 } catch (IncompatibleClassChangeError e) {
105 console.getShell().err().println("ERROR> " + e.getLocalizedMessage());
106 console.getShell().err().println("Error parsing statement: " + statement);
107 logException(e);
108 } catch (Exception e) {
109 e.printStackTrace(new PrintWriter(out));
110 logException(e);
111 }
112 }
113 return 0;
114 }
115 });
116 console.start();
117 }

Callers

nothing calls this directly

Calls 3

logExceptionMethod · 0.95
evaluateMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected