From dfc254cd57683f394f1b5fdca8c75200b2a9969d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 9 Oct 2023 00:12:59 +0200 Subject: fix: define window.name (#20804) Closes https://github.com/denoland/deno/issues/20750 This matches what browsers do: https://developer.mozilla.org/en-US/docs/Web/API/Window/name In the future we might want to change the behavior to actually update the process name, but that needs a bit of discussion regarding if it needs a permission flag (that would make polyfiling `process.title` setter really easy too). --- runtime/js/99_main.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/js') diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index d2a28838a..ccc61036a 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -489,6 +489,10 @@ function bootstrapMainRuntime(runtimeOptions) { } ObjectDefineProperties(globalThis, mainRuntimeGlobalProperties); ObjectDefineProperties(globalThis, { + // TODO(bartlomieju): in the future we might want to change the + // behavior of setting `name` to actually update the process name. + // Empty string matches what browsers do. + name: util.writable(""), close: util.writable(windowClose), closed: util.getterOnly(() => windowIsClosing), }); -- cgit v1.2.3