From 046ab7dc8aa9cc343bd7de2e5efc2e40d73e4998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 26 Oct 2022 14:18:58 +0200 Subject: [PATCH] feat: Stabilize Deno.osRelease() API (#15973) Closes https://github.com/denoland/deno/issues/15928 --- cli/dts/lib.deno.ns.d.ts | 16 ++++++++++++++++ cli/dts/lib.deno.unstable.d.ts | 17 ----------------- runtime/ops/os.rs | 1 - 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index eea3c79477..1d72e14386 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -344,6 +344,22 @@ declare namespace Deno { */ export const noColor: boolean; + /** + * Returns the release version of the Operating System. + * + * ```ts + * console.log(Deno.osRelease()); + * ``` + * + * Requires `allow-env` permission. + * Under consideration to possibly move to Deno.build or Deno.versions and if + * it should depend sys-info, which may not be desirable. + * + * @tags allow-env + * @category Runtime Environment + */ + export function osRelease(): string; + /** * Options which define the permissions within a test or worker context. * diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 4161765648..ba6d03c7e2 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -226,23 +226,6 @@ declare namespace Deno { */ export function umask(mask?: number): number; - /** **UNSTABLE**: New API, yet to be vetted. - * - * Returns the release version of the Operating System. - * - * ```ts - * console.log(Deno.osRelease()); - * ``` - * - * Requires `allow-sys` permission. - * Under consideration to possibly move to Deno.build or Deno.versions and if - * it should depend sys-info, which may not be desirable. - * - * @tags allow-sys - * @category Runtime Environment - */ - export function osRelease(): string; - /** **UNSTABLE**: New API, yet to be vetted. * * Displays the total amount of free and used physical and swap memory in the diff --git a/runtime/ops/os.rs b/runtime/ops/os.rs index f774e1f2e4..2aafdc7a36 100644 --- a/runtime/ops/os.rs +++ b/runtime/ops/os.rs @@ -182,7 +182,6 @@ fn op_hostname(state: &mut OpState) -> Result { #[op] fn op_os_release(state: &mut OpState) -> Result { - super::check_unstable(state, "Deno.osRelease"); state .borrow_mut::() .sys