diff options
author | Abdullah Ahmed <abdullah_ahmed@brown.edu> | 2019-10-05 19:17:11 -0400 |
---|---|---|
committer | Abdullah Ahmed <abdullah_ahmed@brown.edu> | 2019-10-05 19:17:11 -0400 |
commit | 57b57b2d82b385ec9aa9d59c0899dc8f48a31223 (patch) | |
tree | ea9fef42849fc1341c6da1300bc4e5f25048cb14 /src/debug/Repl.tsx | |
parent | a44e12f4625caca5d75a456f0ba1ab977149ae6e (diff) | |
parent | 961cb1566e16edb353975ec436a4445c1cf3db0f (diff) |
meged
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 = ""; } |