[go: nahoru, domu]

Open Bug 1137316 Opened 10 years ago Updated 2 years ago

Lazify the PluralForm.jsm imports

Categories

(MailNews Core :: Internationalization, enhancement)

enhancement

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: aryx, Assigned: aryx)

Details

Attachments

(5 files)

Attached patch calendar, v1Splinter Review
Similar to bug 996448 in mozilla-central, this bug is about lazily loading PluralForm.jsm
Attachment #8569972 - Flags: review?(philipp)
Attached patch chat/im, v1Splinter Review
Assignee: nobody → archaeopteryx
Status: NEW → ASSIGNED
Attachment #8569974 - Flags: review?(aleth)
Attached patch mailnews, v1Splinter Review
Attachment #8569975 - Flags: review?(neil)
Attachment #8569975 - Flags: review?(mkmelin+mozilla)
Attachment #8569977 - Flags: review?(mkmelin+mozilla) → review+
Comment on attachment 8569972 [details] [diff] [review]
calendar, v1

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

r=philipp with this comment considered:

::: calendar/base/content/calendar-task-tree.xml
@@ +117,5 @@
>          Components.utils.import("resource://gre/modules/Services.jsm");
>          Components.utils.import("resource://calendar/modules/calItemUtils.jsm");
>          Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
> +        XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
> +                                          "resource://gre/modules/PluralForm.jsm");

passing |this| here will define the getter on the binding instance. I think you will have to use Components.getGlobalForObject(this) instead, or maybe just pass |window|
Attachment #8569972 - Flags: review?(philipp) → review+
Attachment #8569975 - Flags: review?(mkmelin+mozilla) → review+
Comment on attachment 8569978 [details] [diff] [review]
suite, v1

Nit: missed one in navigator.js
Attachment #8569978 - Flags: review?(neil) → review+
Attachment #8569975 - Flags: review?(neil) → review+
Comment on attachment 8569974 [details] [diff] [review]
chat/im, v1

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

::: mail/components/im/modules/chatNotifications.jsm
@@ +11,2 @@
>  Cu.import("resource://gre/modules/Timer.jsm");
> +Cu.import("resource://gre/modules/XPCOMUtils.jsm");

I don't think you need this import, as imServices already imports it?
(In reply to neil@parkwaycc.co.uk from comment #6)
> Nit: missed one in navigator.js
That's part of
> __defineGetter__("PluralForm", function() {
>   Components.utils.import("resource://gre/modules/PluralForm.jsm");
>   return this.PluralForm;
> });
and only used at https://dxr.mozilla.org/comm-central/source/suite/common/bookmarks/browser-places.js#176

Doesn't this get only loaded when it's called?

(In reply to aleth [:aleth] from comment #7)
> ::: mail/components/im/modules/chatNotifications.jsm
> @@ +11,2 @@
> >  Cu.import("resource://gre/modules/Timer.jsm");
> > +Cu.import("resource://gre/modules/XPCOMUtils.jsm");
> 
> I don't think you need this import, as imServices already imports it?
But it doesn't export it (it is itself a module). Or did you mean im/content/extensions.js?
(In reply to Archaeopteryx [:aryx] from comment #8)
> (In reply to aleth [:aleth] from comment #7)
> > ::: mail/components/im/modules/chatNotifications.jsm
> > @@ +11,2 @@
> > >  Cu.import("resource://gre/modules/Timer.jsm");
> > > +Cu.import("resource://gre/modules/XPCOMUtils.jsm");
> > 
> > I don't think you need this import, as imServices already imports it?
> But it doesn't export it (it is itself a module). Or did you mean
> im/content/extensions.js?

Ah, you're right.
Attachment #8569974 - Flags: review?(aleth) → review+
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: