Ah, good point. Please add a comment about this.


On Fri, Jun 21, 2013 at 5:41 PM, jbwillms <notifications@github.com> wrote:

> In plugins/chrome.alarms/alarms.js:
>
> >  }
> >
> >  var Event = require('org.chromium.chrome-common.events');
> >  if (Event) {
> >      exports.onAlarm = new Event('onAlarm');
> >  }
> > +
> > +function reregisterAlarms() {
> > +    Object.keys(alarms).forEach(function(name) {
>
> The problem with a regular for-each loop is that alarms can potentially be
> deleted as we are iterating through the loop, since triggerAlarm sometimes
> deletes the alarm if it is a non-repeating alarm. I think it's safer to
> iterate like this.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/MobileChromeApps/chrome-cordova/pull/26/files#r4827735>
> .
>