Closed Bug 1651470 Opened 5 years ago Closed 5 years ago

Logspam in the browser console when typing []] in a devtools console

Categories

(DevTools :: Console, defect)

defect

Tracking

(firefox80 fixed)

RESOLVED FIXED
Firefox 80
Tracking Status
firefox80 --- fixed

People

(Reporter: robwu, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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: []] (bracket, bracket close, bracket close).

Expected:

  • No errors in the global JS console.

Actual:

TypeError: can't access property "length", matchProp is null JSTerm.js:1035:22.

Failed to analyze input string syntax error js-property-provider.js:370:13
(via JSPropertyProvider, "syntax error" from analyzeInputString)

Reproduced on 78.0 and current Nightly, but I have had this problem for a long while.

Assignee: nobody → nchevobbe
Severity: -- → S4
Status: NEW → ASSIGNED

This patch is a mixed bag of fixes:

  • don't log an error when the string couldn't be analyzed, as it can occur
    frequently when the console input isn't valid, and it clutters the browser
    console
  • never return a null matchProp. Default to empty string, so consumer code
    can always assume it's a string
  • don't call trim on a property if it's not a string (it can be an integer at
    this point).
Blocks: 1651475
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: