Closed Bug 1591055 Opened 5 years ago Closed 5 years ago

webconsole/utils.js (server) imports VariableView.jsm (client)

Categories

(DevTools :: Console, task, P3)

task

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1613843

People

(Reporter: jdescottes, Unassigned)

References

Details

Somehow the continuation of Bug 842672.
Even though toolkit -> browser import is no longer an issue, we still import client files from the server webconsole utils.js file:

https://searchfox.org/mozilla-central/rev/088e2cf29c59d733d57af43903eb0267dbf72e2a/devtools/server/actors/webconsole/utils.js#11-15

I am currently adding linters in Bug 1591013 to prevent this kind of things so I am filing this bug to fix the issue.

The methods used from VariablesView seem easy to extract to a shared helper:

  • getGrip
  • getString

But this is only used for the console command pprint, and I'm not sure if this is something we still intentionally support?

Hi Nicolas, any suggestion about what we should do with this? Is pprint still supported?

Flags: needinfo?(nchevobbe)

(In reply to Julian Descottes [:jdescottes] from comment #1)

Hi Nicolas, any suggestion about what we should do with this? Is pprint still supported?

Yes, pprint is still supported, we have a test for it browser_jsterm_helper_pprint.js and it's also documented in https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Helpers

FWIW it's not supported in Chrome, so maybe we could remove it.

Regardless of that, it looks like we could copy those 2 functions in the utils / migrate to actor grips/stringifiers instead.

I can have a look if you want.

Flags: needinfo?(nchevobbe)

Not urgent, I wanted to check in case we could remove one more thing :)

Depends on: 1613843
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.