Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 650 Bytes

File metadata and controls

21 lines (14 loc) · 650 Bytes

use-services

Requires the use of Services rather than Cc[].getService() where a service is already defined in Services.

Examples of incorrect code for this rule:

Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(Components.interfaces.nsIAppStartup);

Examples of correct code for this rule:

Services.wm.addListener()
Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator)