Closed Bug 1738229 Opened 3 years ago Closed 3 years ago

Stop using the second argument to ChromeUtils.import in various files in browser

Categories

(Firefox :: General, task, P3)

task

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: standard8, Assigned: raquelvargas, Mentored)

References

Details

(Keywords: good-first-bug, Whiteboard: [lang=js])

Attachments

(1 file)

Passing this or null as the second argument to ChromeUtils.import(..., null) causes behaviour that we don't want now. As we look towards a new module system we need to prevent this behaviour.

I'm happy to mentor this. For instructions on how to get your local build of Firefox up and running and submit your patch, see https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html

Having an ESLint editor integration set-up is also useful.

What needs doing:

  • Remove the 4 file references for this rule from the top-level .eslintrc.js
  • Run ./mach eslint browser/ to see where the issues are.
  • For fixing the issues see notes below.
  • Re-run ESLint and ensure issues are fixed. If there are issues about formatting you can re-run eslint with --fix to automatically fix those.
  • Now submit your patch.

For fixing the issues:

  • Generally the second argument should be removed and you'll want to end up with something of the form:
let { SelectContentHelper } = ChromeUtils.import("resource://gre/actors/SelectChild.jsm");
  • If the result of the call is not being assigned to something, check for ESLint reporting undefined variables when you remove the second argument, and use those as the variable name using the form above.

Please note this bug will be auto-assigned when the first patch is attached, though you are welcome to comment that you are working on it.

Severity: -- → N/A
Priority: -- → P3
Assignee: nobody → raquelvargas
Status: NEW → ASSIGNED
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ed1595ec5b53
Stop using the second argument to ChromeUtils.import in various files in browser. r=Standard8,webcompat-reviewers,twisniewski
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: