Closed Bug 1245530 Opened 4 years ago Closed 4 years ago

Remove usages of Cu.import(Services.jsm) in favor or require("Services")

Categories

(DevTools :: General, defect)

defect
Not set

Tracking

(firefox47 fixed)

RESOLVED FIXED
Firefox 47
Tracking Status
firefox47 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Today, we mix both Cu.import and require for loading Services.
This is disturbing. Either we consider that require("Services") is really useful and use it everywhere, or we stick with Cu.import(). But we shouldn't have both in our codebase.
Attached patch patch v1 (obsolete) — Splinter Review
Let's try to wrap up with this refactoring patch I keep rebasing...
Assignee: nobody → poirot.alex
Comment on attachment 8722927 [details] [diff] [review]
patch v1

Review of attachment 8722927 [details] [diff] [review]:
-----------------------------------------------------------------

This is a quite dump patch...
Sometimes I have to move around the precise line where I do a require(), as require is often available a few lines after.
Sometimes I already replace lazyImporter with require() as there isn't much value in lazy loading this module!
Attachment #8722927 - Flags: review?(jryans)
Attachment #8722927 - Flags: review?(jryans) → review+
Attached patch patch v2Splinter Review
Rebased.
Attachment #8724402 - Flags: review+
Attachment #8722927 - Attachment is obsolete: true
https://hg.mozilla.org/integration/fx-team/rev/93f0d5522db1bcdb8a7c839930025a2d2f37b443
Bug 1245530 - Use require(Services) instead of Cu.import(Services.jsm). r=jryans
https://hg.mozilla.org/mozilla-central/rev/93f0d5522db1
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 47
Depends on: 1252287
Depends on: 1252346
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.