mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(ext/node): fix global in node env (#15622)
This commit is contained in:
parent
f583a7ebf4
commit
9b324b1cf4
7 changed files with 20 additions and 2 deletions
|
@ -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",
|
||||
|
|
2
cli/tests/testdata/npm/compare_globals/main.js
vendored
Normal file
2
cli/tests/testdata/npm/compare_globals/main.js
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
import * as globals from "npm:@denotest/globals";
|
||||
console.log(globals.global === globals.globalThis);
|
3
cli/tests/testdata/npm/compare_globals/main.out
vendored
Normal file
3
cli/tests/testdata/npm/compare_globals/main.out
vendored
Normal file
|
@ -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
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"name": "@deno/cjs-local-global-decls",
|
||||
"name": "@denotest/cjs-local-global-decls",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
|
|
2
cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.js
vendored
Normal file
2
cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/index.js
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
exports.globalThis = globalThis;
|
||||
exports.global = global;
|
4
cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/package.json
vendored
Normal file
4
cli/tests/testdata/npm/registry/@denotest/globals/1.0.0/package.json
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "@denotest/globals",
|
||||
"version": "1.0.0"
|
||||
}
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue