Bug 1698260 - [devtools] Fix autocomplete for Infinity. r=devtools-reviewers,ochameau.

Differential Revision: https://phabricator.services.mozilla.com/D204478
This commit is contained in:
Nicolas Chevobbe 2024-03-15 05:59:56 +00:00
Родитель ad2357280f
Коммит ead1d58895
2 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -650,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);
}

Просмотреть файл

@ -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");
}
/**