summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/tests/integration/npm_tests.rs7
-rw-r--r--cli/tests/testdata/npm/compare_globals/main.js2
-rw-r--r--cli/tests/testdata/npm/compare_globals/main.out3
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/package.json2
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.js2
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/package.json4
-rw-r--r--ext/node/01_node.js2
7 files changed, 20 insertions, 2 deletions
diff --git a/cli/tests/integration/npm_tests.rs b/cli/tests/integration/npm_tests.rs
index 582284c36..6e47da8f6 100644
--- a/cli/tests/integration/npm_tests.rs
+++ b/cli/tests/integration/npm_tests.rs
@@ -54,6 +54,13 @@ itest!(cjs_local_global_decls {
http_server: true,
});
+itest!(compare_globals {
+ args: "run --allow-read --unstable npm/compare_globals/main.js",
+ output: "npm/compare_globals/main.out",
+ envs: env_vars(),
+ http_server: true,
+});
+
itest!(dynamic_import {
args: "run --allow-read --unstable npm/dynamic_import/main.ts",
output: "npm/dynamic_import/main.out",
diff --git a/cli/tests/testdata/npm/compare_globals/main.js b/cli/tests/testdata/npm/compare_globals/main.js
new file mode 100644
index 000000000..ce43e32b1
--- /dev/null
+++ b/cli/tests/testdata/npm/compare_globals/main.js
@@ -0,0 +1,2 @@
+import * as globals from "npm:@denotest/globals";
+console.log(globals.global === globals.globalThis);
diff --git a/cli/tests/testdata/npm/compare_globals/main.out b/cli/tests/testdata/npm/compare_globals/main.out
new file mode 100644
index 000000000..a1a5c0e8f
--- /dev/null
+++ b/cli/tests/testdata/npm/compare_globals/main.out
@@ -0,0 +1,3 @@
+Download http://localhost:4545/npm/registry/@denotest/globals
+Download http://localhost:4545/npm/registry/@denotest/globals/1.0.0.tgz
+true
diff --git a/cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/package.json b/cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/package.json
index b151deaf6..1048fe76d 100644
--- a/cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/package.json
+++ b/cli/tests/testdata/npm/registry/@denotest/cjs-local-global-decls/1.0.0/package.json
@@ -1,4 +1,4 @@
{
- "name": "@deno/cjs-local-global-decls",
+ "name": "@denotest/cjs-local-global-decls",
"version": "1.0.0"
}
diff --git a/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.js b/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.js
new file mode 100644
index 000000000..be5e6e5ac
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.js
@@ -0,0 +1,2 @@
+exports.globalThis = globalThis;
+exports.global = global;
diff --git a/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/package.json b/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/package.json
new file mode 100644
index 000000000..cba0742c1
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/package.json
@@ -0,0 +1,4 @@
+{
+ "name": "@denotest/globals",
+ "version": "1.0.0"
+}
diff --git a/ext/node/01_node.js b/ext/node/01_node.js
index 8425d3101..883932c5d 100644
--- a/ext/node/01_node.js
+++ b/ext/node/01_node.js
@@ -93,7 +93,7 @@
nodeGlobals.clearImmediate = nativeModuleExports["timers"].clearImmediate;
nodeGlobals.clearInterval = nativeModuleExports["timers"].clearInterval;
nodeGlobals.clearTimeout = nativeModuleExports["timers"].clearTimeout;
- nodeGlobals.global = nodeGlobals;
+ nodeGlobals.global = nodeGlobalThis;
nodeGlobals.process = nativeModuleExports["process"];
nodeGlobals.setImmediate = nativeModuleExports["timers"].setImmediate;
nodeGlobals.setInterval = nativeModuleExports["timers"].setInterval;