diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2024-01-11 07:37:25 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-10 15:37:25 -0700 |
commit | 515a34b4de222e35c7ade1b92614d746e73d4c2e (patch) | |
tree | 8284201fc826a33f12597959a8a8be14e0f524bd /ext/node/polyfills/_fs/_fs_exists.ts | |
parent | d4893eb51a01c5a692d8ca74a3b8ff95c5fd1d9f (diff) |
refactor: use `core.ensureFastOps()` (#21888)
Diffstat (limited to 'ext/node/polyfills/_fs/_fs_exists.ts')
-rw-r--r-- | ext/node/polyfills/_fs/_fs_exists.ts | 9 |
1 files changed, 7 insertions, 2 deletions
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); } |