summaryrefslogtreecommitdiff
path: root/runtime/js/99_main.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-03-27 02:15:08 +0200
committerGitHub <noreply@github.com>2023-03-27 02:15:08 +0200
commitd1a9c4cd7ce0c19ddf9c7c52c0d35d6124a7677d (patch)
tree072e596a689dd431658f55aa8265e593a0920181 /runtime/js/99_main.js
parent355275ec0ffb2f7e93ebb8494e24041d29ec51f0 (diff)
refactor: remove Deno[Deno.internal].nodeUnstable namespace (#18449)
Since we can preserve ops in the snapshot these days, we no longer need to have "Deno[Deno.internal].nodeUnstable" namespace. Instead, various built-in Node.js modules can use appropriate APIs directly.
Diffstat (limited to 'runtime/js/99_main.js')
-rw-r--r--runtime/js/99_main.js64
1 files changed, 0 insertions, 64 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index d043f485e..bc67a5897 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -45,7 +45,6 @@ import * as version from "ext:runtime/01_version.ts";
import * as os from "ext:runtime/30_os.js";
import * as timers from "ext:deno_web/02_timers.js";
import * as colors from "ext:deno_console/01_colors.js";
-import * as net from "ext:deno_net/01_net.js";
import {
inspectArgs,
quoteString,
@@ -59,7 +58,6 @@ import { denoNs, denoNsUnstable } from "ext:runtime/90_deno_ns.js";
import { errors } from "ext:runtime/01_errors.js";
import * as webidl from "ext:deno_webidl/00_webidl.js";
import DOMException from "ext:deno_web/01_dom_exception.js";
-import * as flash from "ext:deno_flash/01_http.js";
import {
mainRuntimeGlobalProperties,
setLanguage,
@@ -455,27 +453,6 @@ function bootstrapMainRuntime(runtimeOptions) {
setUserAgent(runtimeOptions.userAgent);
setLanguage(runtimeOptions.locale);
- // These have to initialized here and not in `90_deno_ns.js` because
- // the op function that needs to be passed will be invalidated by creating
- // a snapshot
- ObjectAssign(internals, {
- nodeUnstable: {
- serve: flash.createServe(ops.op_node_unstable_flash_serve),
- upgradeHttpRaw: flash.upgradeHttpRaw,
- listenDatagram: net.createListenDatagram(
- ops.op_node_unstable_net_listen_udp,
- ops.op_node_unstable_net_listen_unixpacket,
- ),
- },
- });
-
- // 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,
- });
-
ObjectDefineProperties(finalDenoNs, {
pid: util.readOnly(runtimeOptions.pid),
ppid: util.readOnly(runtimeOptions.ppid),
@@ -486,16 +463,6 @@ function bootstrapMainRuntime(runtimeOptions) {
if (runtimeOptions.unstableFlag) {
ObjectAssign(finalDenoNs, denoNsUnstable);
- // These have to initialized here and not in `90_deno_ns.js` because
- // the op function that needs to be passed will be invalidated by creating
- // a snapshot
- ObjectAssign(finalDenoNs, {
- serve: flash.createServe(ops.op_flash_serve),
- listenDatagram: net.createListenDatagram(
- ops.op_net_listen_udp,
- ops.op_net_listen_unixpacket,
- ),
- });
}
// Setup `Deno` global - we're actually overriding already existing global
@@ -573,39 +540,8 @@ function bootstrapWorkerRuntime(
globalThis.pollForMessages = pollForMessages;
- // These have to initialized here and not in `90_deno_ns.js` because
- // the op function that needs to be passed will be invalidated by creating
- // a snapshot
- ObjectAssign(internals, {
- nodeUnstable: {
- serve: flash.createServe(ops.op_node_unstable_flash_serve),
- upgradeHttpRaw: flash.upgradeHttpRaw,
- listenDatagram: net.createListenDatagram(
- ops.op_node_unstable_net_listen_udp,
- ops.op_node_unstable_net_listen_unixpacket,
- ),
- },
- });
-
- // 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,
- });
-
if (runtimeOptions.unstableFlag) {
ObjectAssign(finalDenoNs, denoNsUnstable);
- // These have to initialized here and not in `90_deno_ns.js` because
- // the op function that needs to be passed will be invalidated by creating
- // a snapshot
- ObjectAssign(finalDenoNs, {
- serve: flash.createServe(ops.op_flash_serve),
- listenDatagram: net.createListenDatagram(
- ops.op_net_listen_udp,
- ops.op_net_listen_unixpacket,
- ),
- });
}
ObjectDefineProperties(finalDenoNs, {
pid: util.readOnly(runtimeOptions.pid),