summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-09-28 15:36:06 +0200
committerGitHub <noreply@github.com>2022-09-28 15:36:06 +0200
commitb8e3f4c71dae5b43a03e8cfb36e71865e8eeaabf (patch)
tree369d01d85835aa18548b4892e5a040412c5223fa
parent70bc0eb72b01249b4c1ccc92b51bf5c442b3edc9 (diff)
feat: Stabilize Deno.hostname() API (#15932)
-rw-r--r--cli/diagnostics.rs1
-rw-r--r--cli/dts/lib.deno.ns.d.ts14
-rw-r--r--cli/dts/lib.deno.unstable.d.ts17
-rw-r--r--runtime/ops/os.rs1
4 files changed, 14 insertions, 19 deletions
diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs
index c15832869..d947aaa2b 100644
--- a/cli/diagnostics.rs
+++ b/cli/diagnostics.rs
@@ -40,7 +40,6 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[
"createHttpClient",
"futime",
"futimeSync",
- "hostname",
"kill",
"listen",
"listenDatagram",
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts
index f3e6b1376..a9de9abe0 100644
--- a/cli/dts/lib.deno.ns.d.ts
+++ b/cli/dts/lib.deno.ns.d.ts
@@ -161,6 +161,20 @@ declare namespace Deno {
*/
export function memoryUsage(): MemoryUsage;
+ /**
+ * Get the `hostname` of the machine the Deno process is running on.
+ *
+ * ```ts
+ * console.log(Deno.hostname());
+ * ```
+ *
+ * Requires `allow-sys` permission.
+ *
+ * @tags allow-sys
+ * @category Runtime Environment
+ */
+ export function hostname(): string;
+
/** Reflects the `NO_COLOR` environment variable at program start.
*
* See: https://no-color.org/
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts
index 54b328196..98cae94a4 100644
--- a/cli/dts/lib.deno.unstable.d.ts
+++ b/cli/dts/lib.deno.unstable.d.ts
@@ -942,23 +942,6 @@ declare namespace Deno {
/** **UNSTABLE**: New API, yet to be vetted.
*
- * Get the `hostname` of the machine the Deno process is running on.
- *
- * ```ts
- * console.log(Deno.hostname());
- * ```
- *
- * Requires `allow-sys` permission.
- * Additional consideration is still necessary around the permissions
- * required.
- *
- * @tags allow-sys
- * @category Runtime Environment
- */
- export function hostname(): string;
-
- /** **UNSTABLE**: New API, yet to be vetted.
- *
* A custom HttpClient for use with `fetch`.
*
* ```ts
diff --git a/runtime/ops/os.rs b/runtime/ops/os.rs
index 0e51e3120..0c171d710 100644
--- a/runtime/ops/os.rs
+++ b/runtime/ops/os.rs
@@ -173,7 +173,6 @@ fn op_loadavg(state: &mut OpState) -> Result<(f64, f64, f64), AnyError> {
#[op]
fn op_hostname(state: &mut OpState) -> Result<String, AnyError> {
- super::check_unstable(state, "Deno.hostname");
state
.borrow_mut::<Permissions>()
.sys