aboutsummaryrefslogtreecommitdiff
path: root/src/debug/Repl.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-05-05 18:28:35 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-05-05 18:28:35 -0400
commit86f55d8aa12268fe847eaa344e8efbab5d293f34 (patch)
tree6bbc5c6fb6825ef969ed0342e4851667b81577cc /src/debug/Repl.tsx
parent2a9db784a6e3492a8f7d8ce9a745b4f1a0494241 (diff)
parent139600ab7e8a82a31744cd3798247236cd5616fc (diff)
Merge branch 'nathan-starter' of https://github.com/brown-dash/Dash-Web into nathan-starter
Diffstat (limited to 'src/debug/Repl.tsx')
-rw-r--r--src/debug/Repl.tsx18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/debug/Repl.tsx b/src/debug/Repl.tsx
index a9f7c085f..8ac502348 100644
--- a/src/debug/Repl.tsx
+++ b/src/debug/Repl.tsx
@@ -30,7 +30,7 @@ class Repl extends React.Component {
if (!script.compiled) {
this.executedCommands.push({ command: this.text, result: 'Compile Error' });
} else {
- const result = script.run({ makeInterface }, e => this.executedCommands.push({ command: this.text, result: e.message || e }));
+ const result = script.run({ makeInterface }, err => this.executedCommands.push({ command: this.text, result: err.message || err }));
result.success && this.executedCommands.push({ command: this.text, result: result.result });
}
this.text = '';
@@ -39,15 +39,13 @@ class Repl extends React.Component {
@computed
get commands() {
- return this.executedCommands.map(command => {
- return (
- <div style={{ marginTop: '5px' }}>
- <p>{command.command}</p>
- {/* <pre>{JSON.stringify(command.result, null, 2)}</pre> */}
- <pre>{command.result instanceof RefField || command.result instanceof ObjectField ? 'object' : String(command.result)}</pre>
- </div>
- );
- });
+ return this.executedCommands.map(command => (
+ <div style={{ marginTop: '5px' }}>
+ <p>{command.command}</p>
+ {/* <pre>{JSON.stringify(command.result, null, 2)}</pre> */}
+ <pre>{command.result instanceof RefField || command.result instanceof ObjectField ? 'object' : String(command.result)}</pre>
+ </div>
+ ));
}
render() {