Bug 1590472 Comment 13 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Khushil Mistry [:khushil324] from comment #11)
> 
> "this" will be calendar provider as it is a function of the "calprovider" base class.

Hm, I don't think so.  I agree that if we used "this" in the new function, it would be the `calprovider` object from calProviderUtils.jsm (which is the same as the `cal.provider` namespace, which contains utilities for working with providers).  However, I thought what we needed is a `[calICalendarProvider](https://searchfox.org/comm-central/source/calendar/base/public/calICalendarProvider.idl)` object like `CalICSProvider` or `CalDavProvider`.  (I thought that was what "this" was referring to before you moved the code into calProviderUtils.jsm.)  But...

...but then the constructor for `BadCertHandler` doesn't have a docstring for the type of its argument "thisProvider".  (Can you add that while we are here and when we get this figured out?)  The properties of `thisProvider` that are used are `.canRefresh` and `.refresh()`.  There is no `calprovider.canRefresh` or `calprovider.refresh()` so we know `calprovider` is not what we want to pass to `BadCertHandler`.  

`canRefresh` and `refresh` are properties of [calICalendar](https://hg.mozilla.org/comm-central/raw-file/tip/calendar/base/public/calICalendar.idl) objects, and I don't see any other uses of them.  So despite the arg name "thisProvider" what BadCertHandler appears to want is a calICalendar, not a calICalendarProvider.  I'll let you figure out which calICalendar we need and how to get ahold of it.

(Did I mention that "this" is not my favorite JS feature?)

Aside: in looking at this I see that `calprovider.BaseClass` has the doc string "Base prototype to be used implementing a provider." but it is actually used for calICalendar objects (not providers), so can we improve that while we're here, maybe something like "Base prototype to be used implementing a calICalendar".
(In reply to Khushil Mistry [:khushil324] from comment #11)
> 
> "this" will be calendar provider as it is a function of the "calprovider" base class.

Hm, I don't think so.  I agree that if we used "this" in the new function, it would be the `calprovider` object from calProviderUtils.jsm (which is the same as the `cal.provider` namespace, which contains utilities for working with providers).  However, I thought what we needed is a [calICalendarProvider](https://searchfox.org/comm-central/source/calendar/base/public/calICalendarProvider.idl) object like `CalICSProvider` or `CalDavProvider`.  (I thought that was what "this" was referring to before you moved the code into calProviderUtils.jsm.)  But...

...but then the constructor for `BadCertHandler` doesn't have a docstring for the type of its argument "thisProvider".  (Can you add that while we are here and when we get this figured out?)  The properties of `thisProvider` that are used are `.canRefresh` and `.refresh()`.  There is no `calprovider.canRefresh` or `calprovider.refresh()` so we know `calprovider` is not what we want to pass to `BadCertHandler`.  

`canRefresh` and `refresh` are properties of [calICalendar](https://hg.mozilla.org/comm-central/raw-file/tip/calendar/base/public/calICalendar.idl) objects, and I don't see any other uses of them.  So despite the arg name "thisProvider" what BadCertHandler appears to want is a calICalendar, not a calICalendarProvider.  I'll let you figure out which calICalendar we need and how to get ahold of it.

(Did I mention that "this" is not my favorite JS feature?)

Aside: in looking at this I see that `calprovider.BaseClass` has the doc string "Base prototype to be used implementing a provider." but it is actually used for calICalendar objects (not providers), so can we improve that while we're here, maybe something like "Base prototype to be used implementing a calICalendar".

Back to Bug 1590472 Comment 13