diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-03-08 13:09:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-08 13:09:22 +0100 |
commit | 1b6f8318750d319d689f7eeef9e7e1f2e56b94a6 (patch) | |
tree | b2e182b77cfbcd25ee893113de9f61509e16e787 /cli/js/compiler_imports.ts | |
parent | b9037c86ed8d1d55a59a1c1298fa12bbfcae6873 (diff) |
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
Diffstat (limited to 'cli/js/compiler_imports.ts')
-rw-r--r-- | cli/js/compiler_imports.ts | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/cli/js/compiler_imports.ts b/cli/js/compiler_imports.ts index 387c47fc4..377df4098 100644 --- a/cli/js/compiler_imports.ts +++ b/cli/js/compiler_imports.ts @@ -7,9 +7,9 @@ import { } from "./compiler_sourcefile.ts"; import { normalizeString, CHAR_FORWARD_SLASH } from "./compiler_util.ts"; import { cwd } from "./dir.ts"; -import { sendAsync, sendSync } from "./dispatch_json.ts"; import { assert } from "./util.ts"; import * as util from "./util.ts"; +import * as compilerOps from "./ops/compiler.ts"; /** Resolve a path to the final path segment passed. */ function resolvePath(...pathSegments: string[]): string { @@ -68,7 +68,7 @@ export function resolveModules( referrer?: string ): string[] { util.log("compiler_imports::resolveModules", { specifiers, referrer }); - return sendSync("op_resolve_modules", { specifiers, referrer }); + return compilerOps.resolveModules(specifiers, referrer); } /** Ops to Rust to fetch modules meta data. */ @@ -77,10 +77,7 @@ function fetchSourceFiles( referrer?: string ): Promise<SourceFileJson[]> { util.log("compiler_imports::fetchSourceFiles", { specifiers, referrer }); - return sendAsync("op_fetch_source_files", { - specifiers, - referrer - }); + return compilerOps.fetchSourceFiles(specifiers, referrer); } /** Given a filename, determine the media type based on extension. Used when |