diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-05-28 20:00:50 -0400 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-05-28 20:00:50 -0400 |
commit | 435f0c8ef035995001dde92f8e7a04fe35a3a41d (patch) | |
tree | c7ec942c44b48710e652167249e570a549412657 /src/debug/Repl.tsx | |
parent | 7cd5d922930ba1eaed894c2b0a91e3edf4f08164 (diff) |
Added default values for Document Schemas
Diffstat (limited to 'src/debug/Repl.tsx')
-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 { |