summaryrefslogtreecommitdiff
path: root/cli/node/analyze.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-11-02 19:08:09 -0400
committerGitHub <noreply@github.com>2022-11-02 19:08:09 -0400
commit77fb26e143d635f713a1ded93100210878c61f19 (patch)
tree3753ae34c4ccc19c231632d28218d8066ab4ea60 /cli/node/analyze.rs
parent5140795662a9d5eb13031912fa193b7305779c1f (diff)
fix(npm): add `console` global for node environment (#16519)
This global is already isolated to node during type checking. Closes #16518
Diffstat (limited to 'cli/node/analyze.rs')
-rw-r--r--cli/node/analyze.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/cli/node/analyze.rs b/cli/node/analyze.rs
index 9b449f675..acf7a662f 100644
--- a/cli/node/analyze.rs
+++ b/cli/node/analyze.rs
@@ -19,6 +19,7 @@ static NODE_GLOBALS: &[&str] = &[
"clearImmediate",
"clearInterval",
"clearTimeout",
+ "console",
"global",
"process",
"setImmediate",
@@ -194,9 +195,10 @@ mod tests {
"var globalThis = {}",
";var Buffer = globalThis.Buffer;",
"var clearImmediate = globalThis.clearImmediate;var clearInterval = globalThis.clearInterval;",
- "var clearTimeout = globalThis.clearTimeout;var global = globalThis.global;",
- "var process = globalThis.process;var setImmediate = globalThis.setImmediate;",
- "var setInterval = globalThis.setInterval;var setTimeout = globalThis.setTimeout;\n",
+ "var clearTimeout = globalThis.clearTimeout;var console = globalThis.console;",
+ "var global = globalThis.global;var process = globalThis.process;",
+ "var setImmediate = globalThis.setImmediate;var setInterval = globalThis.setInterval;",
+ "var setTimeout = globalThis.setTimeout;\n",
"export const x = 1;"
),
NODE_GLOBAL_THIS_NAME.as_str(),