reorg: move JS ops implementations to cli/js/ops/, part 1 (#4264)

Following JS ops were moved to separate files in cli/js/ops directory:
- compiler
- dispatch_json
- dispatch_minimal
- errors
- fetch
- fs_events
- os
- random
- repl
- resources
- runtime_compiler
- runtime
- tty
This commit is contained in:
Bartek Iwańczuk 2020-03-08 13:09:22 +01:00 committed by GitHub
parent b9037c86ed
commit 1b6f831875
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
57 changed files with 304 additions and 213 deletions

View file

@ -1,32 +1,13 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { core } from "./core.ts";
import * as dispatch from "./dispatch.ts";
import { sendSync } from "./dispatch_json.ts";
import { assert } from "./util.ts";
import * as util from "./util.ts";
import { OperatingSystem, Arch } from "./build.ts";
import { setBuildInfo } from "./build.ts";
import { setVersions } from "./version.ts";
import { setLocation } from "./web/location.ts";
import { setPrepareStackTrace } from "./error_stack.ts";
interface Start {
cwd: string;
pid: number;
args: string[];
location: string; // Absolute URL.
repl: boolean;
debugFlag: boolean;
depsFlag: boolean;
typesFlag: boolean;
versionFlag: boolean;
denoVersion: string;
v8Version: string;
tsVersion: string;
noColor: boolean;
os: OperatingSystem;
arch: Arch;
}
import { Start, start as startOp } from "./ops/runtime.ts";
export let OPS_CACHE: { [name: string]: number };
@ -49,7 +30,7 @@ export function start(preserveDenoNamespace = true, source?: string): Start {
// First we send an empty `Start` message to let the privileged side know we
// are ready. The response should be a `StartRes` message containing the CLI
// args and other info.
const s = sendSync("op_start");
const s = startOp();
setVersions(s.denoVersion, s.v8Version, s.tsVersion);
setBuildInfo(s.os, s.arch);