tor-browser

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

commit e1e2f733576fa38f3050b04846e7674614d83184
parent ad0ae2c01b2fcd3f159d45e3733ddb53cc551af1
Author: Lorenz A <me@lorenzackermann.xyz>
Date:   Thu, 11 Dec 2025 07:11:39 +0000

Bug 2004230 - [devtools] Turn devtools/shared/security/auth.js into an ES class. r=devtools-reviewers,bomsy

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

Diffstat:
Mdevtools/shared/security/auth.js | 22++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/devtools/shared/security/auth.js b/devtools/shared/security/auth.js @@ -80,9 +80,8 @@ var Prompt = (Authenticators.Prompt = {}); Prompt.mode = "PROMPT"; -Prompt.Client = function () {}; -Prompt.Client.prototype = { - mode: Prompt.mode, +Prompt.Client = class { + mode = Prompt.mode; /** * When client is about to make a new connection, verify that the connection settings @@ -90,7 +89,7 @@ Prompt.Client.prototype = { * * @throws if validation requirements are not met */ - validateSettings() {}, + validateSettings() {} /** * When client has just made a new socket connection, validate the connection @@ -109,7 +108,7 @@ Prompt.Client.prototype = { */ validateConnection() { return true; - }, + } /** * Work with the server to complete any additional steps required by this @@ -127,12 +126,11 @@ Prompt.Client.prototype = { * A transport that can be used to communicate with the server. * @return A promise can be used if there is async behavior. */ - authenticate() {}, + authenticate() {} }; -Prompt.Server = function () {}; -Prompt.Server.prototype = { - mode: Prompt.mode, +Prompt.Server = class { + mode = Prompt.mode; /** * Augment the service discovery advertisement with any additional data needed @@ -145,7 +143,7 @@ Prompt.Server.prototype = { */ augmentAdvertisement(listener, advertisement) { advertisement.authentication = Prompt.mode; - }, + } /** * Determine whether a connection the server should be allowed or not based on @@ -176,7 +174,7 @@ Prompt.Server.prototype = { client, server, }); - }, + } /** * Prompt the user to accept or decline the incoming connection. The default @@ -202,7 +200,7 @@ Prompt.Server.prototype = { * @return An AuthenticationResult value. * A promise that will be resolved to the above is also allowed. */ - allowConnection: prompt.Server.defaultAllowConnection, + allowConnection = prompt.Server.defaultAllowConnection; }; exports.Authenticators = {