Open Bug 1651475 Opened 5 years ago Updated 5 years ago

Logspam in the browser console when trying to access a property in a devtools console

Categories

(DevTools :: Console, defect)

defect

Tracking

(Not tracked)

People

(Reporter: robwu, Unassigned)

References

Details

STR:

  1. Visit about:config and set chrome.devtools.enabled to true.
    (this is to unlock the console input in the global JS console; the pref is not needed if you run step 3 from a tab's console instead of the global JS console)
  2. Open the global JS console (Ctrl-Shift-J, to view browser errors).
  3. Focus the input of the console and type:
    1[0].
    (this may look like nonsense, but this is the minimal reproduction that I can come up with. In practice, I tried to type code that would return an array, and intended to do something with an element: [0]. ).

Expected:

  • No errors in the global JS console.

Actual:

TypeError: properties.shift().trim is not a function ... in resource://devtools/shared/webconsole/js-property-provider.js:274

Error while calling actor 'console's method 'autocomplete' can't access property "matches", result is undefined ... in resource://devtools/server/actors/webconsole.js:1401

The real issue is probably the first error, but it wouldn't hurt to also fix the second one by changing === null to == null at https://searchfox.org/mozilla-central/rev/85ae3b911d5fcabd38ef315725df32e25edef83b/devtools/server/actors/webconsole.js#1388

The severity field is not set for this bug.
:nchevobbe, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(nchevobbe)
Severity: -- → S4
Flags: needinfo?(nchevobbe)

The first part of the bug got fixed by the patch from bug 1651470.

What remains (to fix the second error) is to replace === null with == null at https://searchfox.org/mozilla-central/rev/828f2319c0195d7f561ed35533aef6fe183e68e3/devtools/server/actors/webconsole.js#1394

Depends on: 1651470

All the error are gone, and I think we can close this bug.

(In reply to Rob Wu [:robwu] from comment #2)

What remains (to fix the second error) is to replace === null with == null at https://searchfox.org/mozilla-central/rev/828f2319c0195d7f561ed35533aef6fe183e68e3/devtools/server/actors/webconsole.js#1394

I don't think there's an issue with this code. JSPropertyProvider only return objects or null when an error was encountered.
Am I missing something Rob?

You need to log in before you can comment on or make changes to this bug.