summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-01-24 18:54:10 +0100
committerGitHub <noreply@github.com>2023-01-24 18:54:10 +0100
commitabd96105300a7729a4d8eb69af2e81dd6307a163 (patch)
tree75b7556f876b2a2df3e22b905922dfb11572ef6d /runtime/js
parent1084027d502d54ebf256c867fe85600b295d8a06 (diff)
refactor: remove Deno.core (#16881)
This commit removes "Deno.core" namespace. It is strictly private API that has no stability guarantees, we were supposed to remove it long time ago. Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/99_main.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index ea519cb35..e1d089bc5 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -485,8 +485,14 @@ delete Intl.v8BreakIterator;
},
});
- const finalDenoNs = {
+ // FIXME(bartlomieju): temporarily add whole `Deno.core` to
+ // `Deno[Deno.internal]` namespace. It should be removed and only necessary
+ // methods should be left there.
+ ObjectAssign(internals, {
core,
+ });
+
+ const finalDenoNs = {
internal: internalSymbol,
[internalSymbol]: internals,
resources: core.resources,
@@ -524,7 +530,6 @@ delete Intl.v8BreakIterator;
// Setup `Deno` global - we're actually overriding already existing global
// `Deno` with `Deno` namespace from "./deno.ts".
ObjectDefineProperty(globalThis, "Deno", util.readOnly(finalDenoNs));
- ObjectFreeze(globalThis.Deno.core);
util.log("args", runtimeOptions.args);
}
@@ -625,8 +630,14 @@ delete Intl.v8BreakIterator;
},
});
- const finalDenoNs = {
+ // FIXME(bartlomieju): temporarily add whole `Deno.core` to
+ // `Deno[Deno.internal]` namespace. It should be removed and only necessary
+ // methods should be left there.
+ ObjectAssign(internals, {
core,
+ });
+
+ const finalDenoNs = {
internal: internalSymbol,
[internalSymbol]: internals,
resources: core.resources,
@@ -660,7 +671,6 @@ delete Intl.v8BreakIterator;
// Setup `Deno` global - we're actually overriding already
// existing global `Deno` with `Deno` namespace from "./deno.ts".
ObjectDefineProperty(globalThis, "Deno", util.readOnly(finalDenoNs));
- ObjectFreeze(globalThis.Deno.core);
}
ObjectDefineProperties(globalThis, {