Bug 1332610 - Don't eagerly create Intl.DateTimeFormat in LoginManagerContextMenu.jsm. r=johannh

MozReview-Commit-ID: IuXdWyy4C7b

--HG--
extra : rebase_source : cfe475768cd6c1cc051c5ba7981b82d428278eb3
This commit is contained in:
Matthew Noorenberghe 2017-01-23 11:27:10 -08:00
parent 0d9917ce74
commit cf0a1e0be3

View File

@ -19,8 +19,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "LoginManagerParent",
* Password manager object for the browser contextual menu.
*/
var LoginManagerContextMenu = {
dateAndTimeFormatter: new Intl.DateTimeFormat(undefined,
{ day: "numeric", month: "short", year: "numeric" }),
/**
* Look for login items and add them to the contextual menu.
*
@ -35,7 +33,6 @@ var LoginManagerContextMenu = {
* @returns {DocumentFragment} a document fragment with all the login items.
*/
addLoginsToMenu(inputElement, browser, documentURI) {
let foundLogins = this._findLogins(documentURI);
if (!foundLogins.length) {
@ -192,3 +189,11 @@ XPCOMUtils.defineLazyGetter(LoginManagerContextMenu, "_stringBundle", function()
return Services.strings.
createBundle("chrome://passwordmgr/locale/passwordmgr.properties");
});
XPCOMUtils.defineLazyGetter(LoginManagerContextMenu, "dateAndTimeFormatter", function() {
return new Intl.DateTimeFormat(undefined, {
day: "numeric",
month: "short",
year: "numeric",
});
});