From b72f0be27c382f2d4e5d272ce9ed2211af584d80 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Thu, 15 Feb 2024 10:20:17 +0530 Subject: chore: add DENO_FUTURE env var (#22318) Closes https://github.com/denoland/deno/issues/22315 ``` ~> DENO_FUTURE=1 target/debug/deno > globalThis.window undefined ``` --- runtime/js/99_main.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/js') diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 965af460d..11c26798b 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -647,6 +647,7 @@ function bootstrapMainRuntime(runtimeOptions) { 6: maybeBinaryNpmCommandName, 7: shouldDisableDeprecatedApiWarning, 8: shouldUseVerboseDeprecatedApiWarning, + 9: future, } = runtimeOptions; removeImportedOps(); @@ -769,6 +770,10 @@ function bootstrapMainRuntime(runtimeOptions) { if (nodeBootstrap) { nodeBootstrap(hasNodeModulesDir, maybeBinaryNpmCommandName); } + + if (future) { + delete globalThis.window; + } } function bootstrapWorkerRuntime( -- cgit v1.2.3