summaryrefslogtreecommitdiffstats
path: root/devtools/shared/webconsole
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /devtools/shared/webconsole
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/shared/webconsole')
-rw-r--r--devtools/shared/webconsole/js-property-provider.js16
-rw-r--r--devtools/shared/webconsole/parser-helper.js10
-rw-r--r--devtools/shared/webconsole/test/chrome/common.js2
-rw-r--r--devtools/shared/webconsole/test/chrome/helper_serviceworker.js4
-rw-r--r--devtools/shared/webconsole/test/chrome/test_console_serviceworker.html4
-rw-r--r--devtools/shared/webconsole/test/chrome/test_console_styling.html4
-rw-r--r--devtools/shared/webconsole/test/chrome/test_consoleapi.html4
-rw-r--r--devtools/shared/webconsole/test/chrome/test_consoleapi_innerID.html2
-rw-r--r--devtools/shared/webconsole/test/chrome/test_network_security-hsts.html2
-rw-r--r--devtools/shared/webconsole/test/xpcshell/test_js_property_provider.js5
10 files changed, 34 insertions, 19 deletions
diff --git a/devtools/shared/webconsole/js-property-provider.js b/devtools/shared/webconsole/js-property-provider.js
index ca30e8f57b..bf02207a26 100644
--- a/devtools/shared/webconsole/js-property-provider.js
+++ b/devtools/shared/webconsole/js-property-provider.js
@@ -19,9 +19,15 @@ if (!isWorker) {
);
}
const lazy = {};
-ChromeUtils.defineESModuleGetters(lazy, {
- Reflect: "resource://gre/modules/reflect.sys.mjs",
-});
+if (!isWorker) {
+ ChromeUtils.defineESModuleGetters(
+ lazy,
+ {
+ Reflect: "resource://gre/modules/reflect.sys.mjs",
+ },
+ { global: "contextual" }
+ );
+}
loader.lazyRequireGetter(
this,
[
@@ -644,7 +650,7 @@ function getMatchedPropsImpl(obj, match, { chainIterator, getProperties }) {
// This uses a trick: converting a string to a number yields NaN if
// the operation failed, and NaN is not equal to itself.
// eslint-disable-next-line no-self-compare
- if (+prop != +prop) {
+ if (+prop != +prop || prop === "Infinity") {
matches.add(prop);
}
@@ -746,7 +752,7 @@ var DebuggerObjectSupport = {
}
},
- getProperty(obj, name, rootObj) {
+ getProperty() {
// This is left unimplemented in favor to DevToolsUtils.getProperty().
throw new Error("Unimplemented!");
},
diff --git a/devtools/shared/webconsole/parser-helper.js b/devtools/shared/webconsole/parser-helper.js
index 69981781b5..30510ab58b 100644
--- a/devtools/shared/webconsole/parser-helper.js
+++ b/devtools/shared/webconsole/parser-helper.js
@@ -5,9 +5,13 @@
const DevToolsUtils = require("resource://devtools/shared/DevToolsUtils.js");
const lazy = {};
-ChromeUtils.defineESModuleGetters(lazy, {
- Reflect: "resource://gre/modules/reflect.sys.mjs",
-});
+ChromeUtils.defineESModuleGetters(
+ lazy,
+ {
+ Reflect: "resource://gre/modules/reflect.sys.mjs",
+ },
+ { global: "contextual" }
+);
/**
* Gets a collection of parser methods for a specified source.
diff --git a/devtools/shared/webconsole/test/chrome/common.js b/devtools/shared/webconsole/test/chrome/common.js
index 62878d7e60..0e570ba8ed 100644
--- a/devtools/shared/webconsole/test/chrome/common.js
+++ b/devtools/shared/webconsole/test/chrome/common.js
@@ -249,7 +249,7 @@ function withActiveServiceWorker(win, url, scope) {
// workers state change events to determine when its activated.
return new Promise(resolve => {
const sw = swr.waiting || swr.installing;
- sw.addEventListener("statechange", function stateHandler(evt) {
+ sw.addEventListener("statechange", function stateHandler() {
if (sw.state === "activated") {
sw.removeEventListener("statechange", stateHandler);
resolve(swr);
diff --git a/devtools/shared/webconsole/test/chrome/helper_serviceworker.js b/devtools/shared/webconsole/test/chrome/helper_serviceworker.js
index 81b92a6ddb..58e934ed2e 100644
--- a/devtools/shared/webconsole/test/chrome/helper_serviceworker.js
+++ b/devtools/shared/webconsole/test/chrome/helper_serviceworker.js
@@ -3,11 +3,11 @@
console.log("script evaluation");
console.log("Here is a SAB", new SharedArrayBuffer(1024));
-addEventListener("install", function (evt) {
+addEventListener("install", function () {
console.log("install event");
});
-addEventListener("activate", function (evt) {
+addEventListener("activate", function () {
console.log("activate event");
});
diff --git a/devtools/shared/webconsole/test/chrome/test_console_serviceworker.html b/devtools/shared/webconsole/test/chrome/test_console_serviceworker.html
index 4cb6332abd..4c15133491 100644
--- a/devtools/shared/webconsole/test/chrome/test_console_serviceworker.html
+++ b/devtools/shared/webconsole/test/chrome/test_console_serviceworker.html
@@ -49,7 +49,7 @@ function forceReloadFrame(iframe) {
function messageServiceWorker(win, scope, message) {
return win.navigator.serviceWorker.getRegistration(scope).then(swr => {
return new Promise(resolve => {
- win.navigator.serviceWorker.onmessage = evt => {
+ win.navigator.serviceWorker.onmessage = () => {
resolve();
};
const sw = swr.active || swr.waiting || swr.installing;
@@ -127,7 +127,7 @@ const startTest = async function () {
};
addEventListener("load", startTest);
-const onAttach = async function (state, response) {
+const onAttach = async function (state) {
onConsoleAPICall = onConsoleAPICall.bind(null, state);
state.webConsoleFront.on("consoleAPICall", onConsoleAPICall);
diff --git a/devtools/shared/webconsole/test/chrome/test_console_styling.html b/devtools/shared/webconsole/test/chrome/test_console_styling.html
index 841e19076f..e928757e4d 100644
--- a/devtools/shared/webconsole/test/chrome/test_console_styling.html
+++ b/devtools/shared/webconsole/test/chrome/test_console_styling.html
@@ -18,7 +18,7 @@ SimpleTest.waitForExplicitFinish();
let expectedConsoleCalls = [];
-function doConsoleCalls(aState)
+function doConsoleCalls()
{
top.console.log("%cOne formatter with no styles");
top.console.log("%cOne formatter", "color: red");
@@ -89,7 +89,7 @@ async function startTest()
onAttach(state, response);
}
-function onAttach(aState, aResponse)
+function onAttach(aState)
{
onConsoleAPICall = onConsoleAPICall.bind(null, aState);
aState.webConsoleFront.on("consoleAPICall", onConsoleAPICall);
diff --git a/devtools/shared/webconsole/test/chrome/test_consoleapi.html b/devtools/shared/webconsole/test/chrome/test_consoleapi.html
index b5d8edf23e..a93f19e55b 100644
--- a/devtools/shared/webconsole/test/chrome/test_consoleapi.html
+++ b/devtools/shared/webconsole/test/chrome/test_consoleapi.html
@@ -18,7 +18,7 @@ SimpleTest.waitForExplicitFinish();
let expectedConsoleCalls = [];
-function doConsoleCalls(aState)
+function doConsoleCalls()
{
const longString = (new Array(DevToolsServer.LONG_STRING_LENGTH + 2)).join("a");
@@ -186,7 +186,7 @@ async function startTest()
onAttach(state, response);
}
-function onAttach(aState, aResponse)
+function onAttach(aState)
{
onConsoleAPICall = onConsoleAPICall.bind(null, aState);
aState.webConsoleFront.on("consoleAPICall", onConsoleAPICall);
diff --git a/devtools/shared/webconsole/test/chrome/test_consoleapi_innerID.html b/devtools/shared/webconsole/test/chrome/test_consoleapi_innerID.html
index a39b29289d..f8a4f55a3c 100644
--- a/devtools/shared/webconsole/test/chrome/test_consoleapi_innerID.html
+++ b/devtools/shared/webconsole/test/chrome/test_consoleapi_innerID.html
@@ -18,7 +18,7 @@ SimpleTest.waitForExplicitFinish();
let expectedConsoleCalls = [];
-function doConsoleCalls(aState)
+function doConsoleCalls()
{
const { ConsoleAPI } = ChromeUtils.importESModule(
"resource://gre/modules/Console.sys.mjs"
diff --git a/devtools/shared/webconsole/test/chrome/test_network_security-hsts.html b/devtools/shared/webconsole/test/chrome/test_network_security-hsts.html
index 32582e5909..ee01456865 100644
--- a/devtools/shared/webconsole/test/chrome/test_network_security-hsts.html
+++ b/devtools/shared/webconsole/test/chrome/test_network_security-hsts.html
@@ -52,7 +52,7 @@ async function startTest()
SimpleTest.finish();
}
-async function checkHSTS({desc, url, usesHSTS}) {
+async function checkHSTS({ url, usesHSTS}) {
info("Testing HSTS for " + url);
const commands = await createCommandsForTab();
const resourceCommand = commands.resourceCommand;
diff --git a/devtools/shared/webconsole/test/xpcshell/test_js_property_provider.js b/devtools/shared/webconsole/test/xpcshell/test_js_property_provider.js
index 891eadb342..3b1929d46d 100644
--- a/devtools/shared/webconsole/test/xpcshell/test_js_property_provider.js
+++ b/devtools/shared/webconsole/test/xpcshell/test_js_property_provider.js
@@ -164,6 +164,7 @@ function runChecks(dbgObject, environment, sandbox) {
info("Test that suggestions are given for '(globalThis).'");
results = propertyProvider("(globalThis).");
test_has_result(results, "testObject");
+ test_has_result(results, "Infinity");
info(
"Test that suggestions are given for deep 'globalThis' properties access"
@@ -705,6 +706,10 @@ function runChecks(dbgObject, environment, sandbox) {
results = propertyProvider(`testSelfPrototypeProxy.`);
test_has_result(results, `hello`);
test_has_result(results, `hasOwnProperty`);
+
+ info("Test suggestion for Infinity");
+ results = propertyProvider("Inf");
+ test_has_result(results, "Infinity");
}
/**