tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 959de40681ae878815a0db8f4ff5de226f423ac4
parent 3ea539dde1ef7c658c339f5e5a0c20914951c83c
Author: Jon Coppeard <jcoppeard@mozilla.com>
Date:   Tue, 14 Oct 2025 06:49:20 +0000

Bug 1966745 - Part 1: Add a shell switch to disable symbols as weakmap keys r=sfink

Differential Revision: https://phabricator.services.mozilla.com/D268376

Diffstat:
Mjs/src/shell/js.cpp | 12+++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp @@ -12821,6 +12821,8 @@ bool InitOptionParser(OptionParser& op) { "Disable Object.groupBy and Map.groupBy") || !op.addBoolOption('\0', "enable-symbols-as-weakmap-keys", "Enable Symbols As WeakMap keys") || + !op.addBoolOption('\0', "no-symbols-as-weakmap-keys", + "Disable Symbols As WeakMap keys") || !op.addBoolOption('\0', "enable-uint8array-base64", "Enable Uint8Array base64/hex methods") || !op.addBoolOption('\0', "enable-regexp-duplicate-named-groups", @@ -13235,9 +13237,17 @@ bool SetGlobalOptionsPreJSInit(const OptionParser& op) { if (op.getBoolOption("enable-error-iserror")) { JS::Prefs::set_experimental_error_iserror(true); } + + bool symbolsAsWeakMapKeys = false; if (op.getBoolOption("enable-symbols-as-weakmap-keys")) { - JS::Prefs::setAtStartup_experimental_symbols_as_weakmap_keys(true); + symbolsAsWeakMapKeys = true; + } + if (op.getBoolOption("no-symbols-as-weakmap-keys")) { + symbolsAsWeakMapKeys = false; } + JS::Prefs::setAtStartup_experimental_symbols_as_weakmap_keys( + symbolsAsWeakMapKeys); + #ifdef NIGHTLY_BUILD if (op.getBoolOption("enable-async-iterator-helpers")) { JS::Prefs::setAtStartup_experimental_async_iterator_helpers(true);