summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/dts/lib.deno.ns.d.ts3
-rw-r--r--cli/dts/lib.deno.unstable.d.ts9
-rw-r--r--cli/ops/runtime.rs1
-rw-r--r--cli/rt/99_main.js6
-rw-r--r--cli/tests/integration_tests.rs2
-rw-r--r--cli/tsc/99_main_compiler.js1
6 files changed, 8 insertions, 14 deletions
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts
index f551ea361..5cb0f432b 100644
--- a/cli/dts/lib.deno.ns.d.ts
+++ b/cli/dts/lib.deno.ns.d.ts
@@ -2025,4 +2025,7 @@ declare namespace Deno {
* called when `Deno.inspect()` is called, or when the object is logged to
* the console. */
export const customInspect: unique symbol;
+
+ /** The URL of the entrypoint module entered from the command-line. */
+ export const mainModule: string;
}
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts
index a7203f778..8a3e872df 100644
--- a/cli/dts/lib.deno.unstable.d.ts
+++ b/cli/dts/lib.deno.unstable.d.ts
@@ -1098,9 +1098,6 @@ declare namespace Deno {
*/
export function hostname(): string;
- /** **UNSTABLE**: The URL of the file that was originally executed from the command-line. */
- export const mainModule: string;
-
/** **UNSTABLE**: new API, yet to be vetted.
* Synchronously truncates or extends the specified file stream, to reach the
* specified `len`. If `len` is not specified then the entire file contents
@@ -1217,7 +1214,7 @@ declare namespace Deno {
/** **UNSTABLE**: New API, yet to be vetted.
* A custom HttpClient for use with `fetch`.
- *
+ *
* ```ts
* const client = new Deno.createHttpClient({ caFile: "./ca.pem" });
* const req = await fetch("https://myserver.com", { client });
@@ -1233,7 +1230,7 @@ declare namespace Deno {
*/
interface CreateHttpClientOptions {
/** A certificate authority to use when validating TLS certificates.
- *
+ *
* Requires `allow-read` permission.
*/
caFile?: string;
@@ -1241,7 +1238,7 @@ declare namespace Deno {
/** **UNSTABLE**: New API, yet to be vetted.
* Create a custom HttpClient for to use with `fetch`.
- *
+ *
* ```ts
* const client = new Deno.createHttpClient({ caFile: "./ca.pem" });
* const req = await fetch("https://myserver.com", { client });
diff --git a/cli/ops/runtime.rs b/cli/ops/runtime.rs
index 1e426ad8a..55f0d9f57 100644
--- a/cli/ops/runtime.rs
+++ b/cli/ops/runtime.rs
@@ -53,7 +53,6 @@ fn op_main_module(
let main_path = std::env::current_dir().unwrap().join(main_url.to_string());
state.check_read_blind(&main_path, "main_module")?;
}
- state.check_unstable("Deno.mainModule");
Ok(JsonOp::Sync(json!(&main)))
}
diff --git a/cli/rt/99_main.js b/cli/rt/99_main.js
index 873e42291..a28eef806 100644
--- a/cli/rt/99_main.js
+++ b/cli/rt/99_main.js
@@ -328,14 +328,10 @@ delete Object.prototype.__proto__;
ppid: util.readOnly(ppid),
noColor: util.readOnly(noColor),
args: util.readOnly(Object.freeze(args)),
+ mainModule: util.getterOnly(opMainModule),
});
if (unstableFlag) {
- Object.defineProperty(
- finalDenoNs,
- "mainModule",
- util.getterOnly(opMainModule),
- );
Object.assign(finalDenoNs, denoNsUnstable);
}
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index c4544669f..e8e8828cc 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -1925,7 +1925,7 @@ itest!(import_meta {
});
itest!(main_module {
- args: "run --quiet --unstable --allow-read --reload main_module.ts",
+ args: "run --quiet --allow-read --reload main_module.ts",
output: "main_module.ts.out",
});
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js
index 23e25237a..f3dde7b1f 100644
--- a/cli/tsc/99_main_compiler.js
+++ b/cli/tsc/99_main_compiler.js
@@ -101,7 +101,6 @@ delete Object.prototype.__proto__;
"PermissionStatus",
"hostname",
"ppid",
- "mainModule",
"ftruncate",
"ftruncateSync",
"fdatasync",