summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/99_main.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index db334caea..91d485069 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -459,6 +459,10 @@ delete Object.prototype.__proto__;
if (hasBootstrapped) {
throw new Error("Worker runtime already bootstrapped");
}
+
+ const consoleFromV8 = window.console;
+ const wrapConsole = window.__bootstrap.console.wrapConsole;
+
// Remove bootstrapping data from the global scope
delete globalThis.__bootstrap;
delete globalThis.bootstrap;
@@ -467,6 +471,10 @@ delete Object.prototype.__proto__;
Object.defineProperties(globalThis, windowOrWorkerGlobalScope);
Object.defineProperties(globalThis, mainRuntimeGlobalProperties);
Object.setPrototypeOf(globalThis, Window.prototype);
+
+ const consoleFromDeno = globalThis.console;
+ wrapConsole(consoleFromDeno, consoleFromV8);
+
eventTarget.setEventTargetData(globalThis);
defineEventHandler(window, "load", null);
@@ -539,6 +547,10 @@ delete Object.prototype.__proto__;
if (hasBootstrapped) {
throw new Error("Worker runtime already bootstrapped");
}
+
+ const consoleFromV8 = window.console;
+ const wrapConsole = window.__bootstrap.console.wrapConsole;
+
// Remove bootstrapping data from the global scope
delete globalThis.__bootstrap;
delete globalThis.bootstrap;
@@ -548,6 +560,10 @@ delete Object.prototype.__proto__;
Object.defineProperties(globalThis, workerRuntimeGlobalProperties);
Object.defineProperties(globalThis, { name: util.readOnly(name) });
Object.setPrototypeOf(globalThis, DedicatedWorkerGlobalScope.prototype);
+
+ const consoleFromDeno = globalThis.console;
+ wrapConsole(consoleFromDeno, consoleFromV8);
+
eventTarget.setEventTargetData(globalThis);
runtimeStart(