1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

fix(ext/node): fix global in node env (#15622)

This commit is contained in:
Yoshiya Hinosawa 2022-08-26 23:39:05 +09:00 committed by GitHub
parent f583a7ebf4
commit 9b324b1cf4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 2 deletions

View file

@ -54,6 +54,13 @@ itest!(cjs_local_global_decls {
http_server: true, 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 { itest!(dynamic_import {
args: "run --allow-read --unstable npm/dynamic_import/main.ts", args: "run --allow-read --unstable npm/dynamic_import/main.ts",
output: "npm/dynamic_import/main.out", output: "npm/dynamic_import/main.out",

View file

@ -0,0 +1,2 @@
import * as globals from "npm:@denotest/globals";
console.log(globals.global === globals.globalThis);

View 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

View file

@ -1,4 +1,4 @@
{ {
"name": "@deno/cjs-local-global-decls", "name": "@denotest/cjs-local-global-decls",
"version": "1.0.0" "version": "1.0.0"
} }

View file

@ -0,0 +1,2 @@
exports.globalThis = globalThis;
exports.global = global;

View file

@ -0,0 +1,4 @@
{
"name": "@denotest/globals",
"version": "1.0.0"
}

View file

@ -93,7 +93,7 @@
nodeGlobals.clearImmediate = nativeModuleExports["timers"].clearImmediate; nodeGlobals.clearImmediate = nativeModuleExports["timers"].clearImmediate;
nodeGlobals.clearInterval = nativeModuleExports["timers"].clearInterval; nodeGlobals.clearInterval = nativeModuleExports["timers"].clearInterval;
nodeGlobals.clearTimeout = nativeModuleExports["timers"].clearTimeout; nodeGlobals.clearTimeout = nativeModuleExports["timers"].clearTimeout;
nodeGlobals.global = nodeGlobals; nodeGlobals.global = nodeGlobalThis;
nodeGlobals.process = nativeModuleExports["process"]; nodeGlobals.process = nativeModuleExports["process"];
nodeGlobals.setImmediate = nativeModuleExports["timers"].setImmediate; nodeGlobals.setImmediate = nativeModuleExports["timers"].setImmediate;
nodeGlobals.setInterval = nativeModuleExports["timers"].setInterval; nodeGlobals.setInterval = nativeModuleExports["timers"].setInterval;