summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_fs/_fs_exists.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/_fs/_fs_exists.ts')
-rw-r--r--ext/node/polyfills/_fs/_fs_exists.ts9
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);
}