Bug 1614914 - Fix TypeError in JsPropertyProvider for debugger keyword. r=Honza.

A check is added, as well as a test to ensure everything
is okay.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicolas Chevobbe 2020-02-13 10:58:52 +00:00
Родитель 68097ebd32
Коммит bed183e1a6
2 изменённых файлов: 8 добавлений и 0 удалений

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

@ -131,6 +131,10 @@ function JSPropertyProvider({
// Finding the last expression since we've sliced up until the dot.
// If there were parse errors this won't exist.
if (lastBody) {
if (!lastBody.expression) {
return null;
}
astExpression = lastBody.expression;
let matchingObject;

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

@ -658,6 +658,10 @@ function runChecks(dbgObject, environment, sandbox) {
results = propertyProvider(`true?<t`);
test_has_no_results(results);
// Test autocompletion on debugger statement does not throw
results = propertyProvider(`debugger.`);
Assert.ok(results === null, "Does not complete a debugger keyword");
}
/**