mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
fix(check): expose more globals from @types/node (#26603)
Extracted out of https://github.com/denoland/deno/pull/26558 Closes https://github.com/denoland/deno/issues/26578
This commit is contained in:
parent
4e38fbd0a3
commit
0e641632c3
4 changed files with 13 additions and 11 deletions
|
@ -1337,18 +1337,12 @@ delete Object.prototype.__proto__;
|
||||||
"console",
|
"console",
|
||||||
"Console",
|
"Console",
|
||||||
"ErrorConstructor",
|
"ErrorConstructor",
|
||||||
"exports",
|
|
||||||
"gc",
|
"gc",
|
||||||
"Global",
|
"Global",
|
||||||
"ImportMeta",
|
"ImportMeta",
|
||||||
"localStorage",
|
"localStorage",
|
||||||
"module",
|
|
||||||
"NodeModule",
|
|
||||||
"NodeRequire",
|
|
||||||
"process",
|
|
||||||
"queueMicrotask",
|
"queueMicrotask",
|
||||||
"RequestInit",
|
"RequestInit",
|
||||||
"require",
|
|
||||||
"ResponseInit",
|
"ResponseInit",
|
||||||
"sessionStorage",
|
"sessionStorage",
|
||||||
"setImmediate",
|
"setImmediate",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"args": "run --allow-read --check=all compare_globals/main.ts",
|
"args": "run --allow-read --check=all main.ts",
|
||||||
"output": "compare_globals/main.out"
|
"output": "main.out"
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,10 +8,11 @@ Download http://localhost:4260/@denotest/globals/1.0.0.tgz
|
||||||
Download http://localhost:4260/@types/node/node-22.5.4.tgz
|
Download http://localhost:4260/@types/node/node-22.5.4.tgz
|
||||||
Download http://localhost:4260/undici-types/undici-types-6.19.8.tgz
|
Download http://localhost:4260/undici-types/undici-types-6.19.8.tgz
|
||||||
[UNORDERED_END]
|
[UNORDERED_END]
|
||||||
Check file:///[WILDCARD]/compare_globals/main.ts
|
Check file:///[WILDCARD]/main.ts
|
||||||
true
|
true
|
||||||
true
|
true
|
||||||
[]
|
[]
|
||||||
|
process equals process true
|
||||||
setTimeout 1 false
|
setTimeout 1 false
|
||||||
setTimeout 2 function
|
setTimeout 2 function
|
||||||
setTimeout 3 function
|
setTimeout 3 function
|
|
@ -5,10 +5,17 @@ console.log(globals.global === globals.globalThis);
|
||||||
// @ts-expect-error even though these are the same object, they have different types
|
// @ts-expect-error even though these are the same object, they have different types
|
||||||
console.log(globals.globalThis === globalThis);
|
console.log(globals.globalThis === globalThis);
|
||||||
console.log(globals.process.execArgv);
|
console.log(globals.process.execArgv);
|
||||||
|
console.log("process equals process", process === globals.process);
|
||||||
|
|
||||||
type AssertTrue<T extends true> = never;
|
type AssertTrue<T extends true> = never;
|
||||||
type _TestNoProcessGlobal = AssertTrue<
|
type _TestHasProcessGlobal = AssertTrue<
|
||||||
typeof globalThis extends { process: any } ? false : true
|
typeof globalThis extends { process: any } ? true : false
|
||||||
|
>;
|
||||||
|
type _TestProcessGlobalVersion = AssertTrue<
|
||||||
|
typeof process.versions.node extends string ? true : false
|
||||||
|
>;
|
||||||
|
type _TestNoBufferGlogal = AssertTrue<
|
||||||
|
typeof globalThis extends { Buffer: any } ? false : true
|
||||||
>;
|
>;
|
||||||
type _TestHasNodeJsGlobal = NodeJS.Architecture;
|
type _TestHasNodeJsGlobal = NodeJS.Architecture;
|
||||||
|
|
Loading…
Reference in a new issue