Closed Bug 1142568 Opened 9 years ago Closed 6 years ago

Clean up global scope pollution from browser-social.js

Categories

(Firefox Graveyard :: SocialAPI, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: dao, Unassigned)

References

Details

browser-social.js does this:

(function() {

XPCOMUtils.defineLazyModuleGetter(this, "PanelFrame",
  "resource:///modules/PanelFrame.jsm");

XPCOMUtils.defineLazyGetter(this, "OpenGraphBuilder", function() {
  let tmp = {};
  Cu.import("resource:///modules/Social.jsm", tmp);
  return tmp.OpenGraphBuilder;
});
...

})();

As it stands, the anonymous function is completely pointless, and all the lazy getters (PanelFrame, OpenGraphBuilder, DynamicResizeWatcher, sizeSocialPanelToContent, CreateSocialStatusWidget, CreateSocialMarkWidget, hookWindowCloseForPanelClose) leak into the browser window's global scope ("this") which is shared with lots of other scripts.
Flags: firefox-backlog+
Blocks: 1509029
browser-social.js is gone.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.