diff options
Diffstat (limited to 'ext/node/polyfills/_fs')
| -rw-r--r-- | ext/node/polyfills/_fs/_fs_cp.js | 12 | ||||
| -rw-r--r-- | ext/node/polyfills/_fs/_fs_exists.ts | 9 |
2 files changed, 14 insertions, 7 deletions
diff --git a/ext/node/polyfills/_fs/_fs_cp.js b/ext/node/polyfills/_fs/_fs_cp.js index 245e3c76b..283b4f542 100644 --- a/ext/node/polyfills/_fs/_fs_cp.js +++ b/ext/node/polyfills/_fs/_fs_cp.js @@ -2,22 +2,24 @@ // deno-lint-ignore-file prefer-primordials +import { core } from "ext:core/mod.js"; +const { + op_node_cp, + op_node_cp_sync, +} = core.ensureFastOps(); + import { getValidatedPath, validateCpOptions, } from "ext:deno_node/internal/fs/utils.mjs"; import { promisify } from "ext:deno_node/internal/util.mjs"; -const core = globalThis.__bootstrap.core; -const ops = core.ops; -const { op_node_cp } = core.ensureFastOps(); - export function cpSync(src, dest, options) { validateCpOptions(options); const srcPath = getValidatedPath(src, "src"); const destPath = getValidatedPath(dest, "dest"); - ops.op_node_cp_sync(srcPath, destPath); + op_node_cp_sync(srcPath, destPath); } export function cp(src, dest, options, callback) { diff --git a/ext/node/polyfills/_fs/_fs_exists.ts b/ext/node/polyfills/_fs/_fs_exists.ts index f930013fe..3c22fc5b8 100644 --- a/ext/node/polyfills/_fs/_fs_exists.ts +++ b/ext/node/polyfills/_fs/_fs_exists.ts @@ -2,7 +2,12 @@ // TODO(petamoriken): enable prefer-primordials for node polyfills // deno-lint-ignore-file prefer-primordials -const core = globalThis.__bootstrap.core; + +import { core } from "ext:core/mod.js"; +const { + op_node_fs_exists_sync, +} = core.ensureFastOps(); + import { pathFromURL } from "ext:deno_web/00_infra.js"; type ExistsCallback = (exists: boolean) => void; @@ -35,5 +40,5 @@ Object.defineProperty(exists, kCustomPromisifiedSymbol, { */ export function existsSync(path: string | URL): boolean { path = path instanceof URL ? pathFromURL(path) : path; - return core.ops.op_node_fs_exists_sync(path); + return op_node_fs_exists_sync(path); } |
