1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-30 11:16:38 -05:00
denoland-deno/cli/tests/testdata/compat/globals.ts
Bartek Iwańczuk b686907a45
feat(compat): inject Node globals (#12342)
This commit adds automatic injection of Node globals when "--compat" flag
is present.

This is done by executing "https://deno.land/std/node/global.ts" as a "side module",
before main module is executed.

This commit makes "--compat" required to be used with "--unstable" flag, as some
of Node globals require unstable Deno APIs.
2021-10-06 19:07:04 +02:00

8 lines
178 B
TypeScript

if (global != window) {
throw new Error("global is not equal to window");
}
console.log(process);
console.log(Buffer);
console.log(setImmediate);
console.log(clearImmediate);