diff options
author | Bartek Iwańczuk <biwanczuk@gmail.com> | 2023-03-27 16:25:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-27 14:25:17 +0000 |
commit | 357bcfcf79fee92195e37bb3f05e247908f207c5 (patch) | |
tree | 0eddf89fc6b0971498bf56586a35bffa9a103efb /ext/node/polyfills/os.ts | |
parent | 2b389ecf62f296712f0a3da488451ba6f19b43f7 (diff) |
Revert "refactor: remove Deno[Deno.internal].nodeUnstable namespace (… (#18458)
…#18449)"
This reverts commit d1a9c4cd7ce0c19ddf9c7c52c0d35d6124a7677d.
Appears this made CI very flaky on macOS, but I can't repeat it locally
yet
Diffstat (limited to 'ext/node/polyfills/os.ts')
-rw-r--r-- | ext/node/polyfills/os.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/node/polyfills/os.ts b/ext/node/polyfills/os.ts index 19e8fd155..69ca19bc5 100644 --- a/ext/node/polyfills/os.ts +++ b/ext/node/polyfills/os.ts @@ -25,11 +25,15 @@ import { validateIntegerRange } from "ext:deno_node/_utils.ts"; import process from "ext:deno_node/process.ts"; import { isWindows, osType } from "ext:deno_node/_util/os.ts"; import { os } from "ext:deno_node/internal_binding/constants.ts"; -import { osUptime } from "ext:runtime/30_os.js"; + export const constants = os; const SEE_GITHUB_ISSUE = "See https://github.com/denoland/deno_std/issues/1436"; +// @ts-ignore Deno[Deno.internal] is used on purpose here +const DenoOsUptime = Deno[Deno.internal]?.nodeUnstable?.osUptime || + Deno.osUptime; + interface CPUTimes { /** The number of milliseconds the CPU has spent in user mode */ user: number; @@ -306,7 +310,7 @@ export function type(): string { /** Returns the Operating System uptime in number of seconds. */ export function uptime(): number { - return osUptime(); + return DenoOsUptime(); } /** Not yet implemented */ |