Skip to content

Commit 3b1af03

Browse files
authored
Only expose a console copy in the realm (#137)
Avoid accidentally overriding the default console methods in workloads.
1 parent bcfc372 commit 3b1af03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

JetStreamDriver.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,9 @@ class ShellScripts extends Scripts {
629629
} else
630630
globalObject = runString("");
631631

632-
globalObject.console = console;
632+
// Expose console copy in the realm so we don't accidentally modify
633+
// the original object.
634+
globalObject.console = Object.assign({}, console);
633635
globalObject.self = globalObject;
634636
globalObject.top = {
635637
currentResolve,

0 commit comments

Comments
 (0)