-
Notifications
You must be signed in to change notification settings - Fork 59
Description
Please see this question here on Microsoft Learn where it's confirmed it is apparently a bug in Microsoft Edge.
I am encountering an issue where a variable is assigned a value, but the value is always undefined
in Microsoft Edge. Strangely, the same code works as expected in Google Chrome. I have confirmed the assigned value is not undefined
, and checked that the code does not have any way to assign undefined
to the variable. Even though hovering over the variable in DevTools shows the correct value, evaluating the variable in the console still results in undefined
. Here is the relevant code:
customElements.define("popup-page", class extends HTMLElement {
// ...
#lastDownload = 0;
// ...
async #download() {
// ...
this.#lastDownload = 0;
// ...
for (let i = 0; i < urls.length; i++) {
// ...
const id = el.downloadId = await this.#attemptItemAsync(url, maxCon, addDelay);
}
}
async #attemptItemAsync(url, maxCon, addDelay) {
try {
if (addDelay > 0) {
const now = Date.now();
if (now - this.#lastDownload < addDelay) {
await sleepAsync(now - this.#lastDownload);
}
this.#lastDownload = now;
}
// ...
}
catch {
return;
}
}
});
I believe this is a bug in Microsoft Edge. When I sideloaded the same extension into Google Chrome, the bug did not occur. Please let me know if you need more information.
AB#52257933