From 1b6f8318750d319d689f7eeef9e7e1f2e56b94a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 8 Mar 2020 13:09:22 +0100 Subject: 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 --- cli/js/compiler_imports.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'cli/js/compiler_imports.ts') 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 { 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 -- cgit v1.2.3