diff options
| author | bob <bcz@cs.brown.edu> | 2019-05-31 18:18:09 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-05-31 18:18:09 -0400 |
| commit | e277337aa2d8bc9528d4b512f64492113ab551f2 (patch) | |
| tree | 47ac10369f1770a26217b6d89cbe7ea237095938 /src/debug | |
| parent | d1b0f462ced168f3a9ac5d007ba1219e98a3b6cf (diff) | |
| parent | e83c2a88303ae6d994a0ac2e84214947cac4d96d (diff) | |
Merge branch 'master' into stackingviewsandmore
Diffstat (limited to 'src/debug')
| -rw-r--r-- | src/debug/Repl.tsx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/debug/Repl.tsx b/src/debug/Repl.tsx index 01acb0e76..c2db3bdcb 100644 --- a/src/debug/Repl.tsx +++ b/src/debug/Repl.tsx @@ -3,6 +3,7 @@ import * as ReactDOM from 'react-dom'; import { observer } from 'mobx-react'; import { observable, computed } from 'mobx'; import { CompileScript } from '../client/util/Scripting'; +import { makeInterface } from '../new_fields/Schema'; @observer class Repl extends React.Component { @@ -15,12 +16,16 @@ class Repl extends React.Component { } onKeyDown = (e: React.KeyboardEvent) => { - if (e.ctrlKey && e.key === "Enter") { - const script = CompileScript(this.text, { addReturn: true, typecheck: false }); + if (!e.ctrlKey && e.key === "Enter") { + e.preventDefault(); + const script = CompileScript(this.text, { + addReturn: true, typecheck: false, + params: { makeInterface: "any" } + }); if (!script.compiled) { this.executedCommands.push({ command: this.text, result: "Compile Error" }); } else { - const result = script.run(); + const result = script.run({ makeInterface }); if (result.success) { this.executedCommands.push({ command: this.text, result: result.result }); } else { |
