mirror of
https://github.com/denoland/deno.git
synced 2025-07-29 08:04:00 +00:00
Add repl (#998)
- Running repl from js side. - Add tests for repl behavior. - Handle ctrl-C and ctrl-D.
This commit is contained in:
parent
5e48a681c4
commit
27ecfc1617
13 changed files with 505 additions and 13 deletions
13
js/main.ts
13
js/main.ts
|
@ -8,6 +8,7 @@ import { libdeno } from "./libdeno";
|
|||
import { args } from "./deno";
|
||||
import { sendSync, handleAsyncMsgFromRust } from "./dispatch";
|
||||
import { promiseErrorExaminer, promiseRejectHandler } from "./promise_util";
|
||||
import { replLoop } from "./repl";
|
||||
import { version } from "typescript";
|
||||
|
||||
function sendStart(): msg.StartRes {
|
||||
|
@ -77,13 +78,13 @@ export default function denoMain() {
|
|||
}
|
||||
log("args", args);
|
||||
Object.freeze(args);
|
||||
|
||||
const inputFn = args[0];
|
||||
if (!inputFn) {
|
||||
console.log("No input script specified.");
|
||||
os.exit(1);
|
||||
}
|
||||
|
||||
compiler.recompile = startResMsg.recompileFlag();
|
||||
compiler.run(inputFn, `${cwd}/`);
|
||||
|
||||
if (inputFn) {
|
||||
compiler.run(inputFn, `${cwd}/`);
|
||||
} else {
|
||||
replLoop();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue