diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2019-10-09 23:30:36 -0400 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2019-10-09 23:30:36 -0400 |
| commit | 5617124a794b8d256e3d24b143b8dd2403cce993 (patch) | |
| tree | 673a288cdbc853d697c2d8294312f563ae9f4e60 /src/debug/Repl.tsx | |
| parent | 2cc7ca6b267d9dd6b1683d59b6966a021339bc18 (diff) | |
| parent | 3b1345616bf2f7101a21c182e0c9719b1e31f899 (diff) | |
merged
Diffstat (limited to 'src/debug/Repl.tsx')
| -rw-r--r-- | src/debug/Repl.tsx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/debug/Repl.tsx b/src/debug/Repl.tsx index 4f4db13d2..fd6b47ff0 100644 --- a/src/debug/Repl.tsx +++ b/src/debug/Repl.tsx @@ -28,12 +28,8 @@ class Repl extends React.Component { if (!script.compiled) { this.executedCommands.push({ command: this.text, result: "Compile Error" }); } else { - const result = script.run({ makeInterface }); - if (result.success) { - this.executedCommands.push({ command: this.text, result: result.result }); - } else { - this.executedCommands.push({ command: this.text, result: result.error.message || result.error }); - } + const result = script.run({ makeInterface }, e => this.executedCommands.push({ command: this.text, result: e.message || e })); + result.success && this.executedCommands.push({ command: this.text, result: result.result }); } this.text = ""; } |
