Using a constructor changes the semantics a bit because it gives the object
a prototype chain. If you ever added something to the constructor's
prototype, then it would be inherited by its instances. There is also the
instance.constructor property, which gets set. Not having a constructor
makes it clear that it's intended as data and not as a class.


On Fri, Jun 21, 2013 at 5:40 PM, jbwillms <notifications@github.com> wrote:

> In plugins/chrome.alarms/alarms.js:
>
> > @@ -3,6 +3,11 @@
> >  // found in the LICENSE file.
> >
> >  var exports = module.exports;
> > +var exec = cordova.require('cordova/exec'
> );
> > +var storage = cordova.require('org.chromium.chrome.storage.Storage');
> > +var platform = cordova.require('cordova/platform');
> > +var bootstrap = cordova.require('org.chromium.chrome-app-bootstrap.bootstrap');
> > +var channel = require('cordova/channel');
> >  var alarms = {};
> >
> >  function Alarm(name, scheduledTime, periodInMinutes, timeoutId) {
>
> I'm not sure I understand the benefit of using makeAlarm() instead of a
> constructor. Does using a constructor cause it to take up additional space
> when serialized?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/MobileChromeApps/chrome-cordova/pull/26/files#r4827732>
> .
>