From 5f34c9be91a42e9087536d63b7e319439ceba756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 5 Mar 2023 18:18:13 -0400 Subject: refactor: move definition of Deno.build from "runtime" to "core" (#18036) We use information about build in several extension crates like "ext/node" or "runtime/". In an effort to move "fs" APIs to a separate crate it is a prerequisite to have this information available outside of the "runtime/" crate. This commit moves definition of "build" object to "Deno.core" that is later forwarded to "Deno.build". --- runtime/js/06_util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/js/06_util.js') diff --git a/runtime/js/06_util.js b/runtime/js/06_util.js index d3c95edba..fc134d52d 100644 --- a/runtime/js/06_util.js +++ b/runtime/js/06_util.js @@ -1,5 +1,6 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. +const core = globalThis.Deno.core; const internals = globalThis.__bootstrap.internals; const primordials = globalThis.__bootstrap.primordials; const { @@ -11,7 +12,6 @@ const { StringPrototypeReplace, TypeError, } = primordials; -import { build } from "internal:runtime/01_build.js"; import { URLPrototype } from "internal:deno_url/00_url.js"; let logDebug = false; let logSource = "JS"; @@ -94,7 +94,7 @@ function pathFromURL(pathOrUrl) { throw new TypeError("Must be a file URL."); } - return build.os == "windows" + return core.build.os == "windows" ? pathFromURLWin32(pathOrUrl) : pathFromURLPosix(pathOrUrl); } -- cgit v1.2.3