addon/-private/ember-scheduler.js
// cribbed from machty's ember-concurrency
cribbed from machty's ember-concurrency
cribbed from machty ' s ember - concurrency
function cleanupOnDestroy(owner, object, cleanupMethodName) {
  if (!owner.willDestroy) {
    return;
  }
  if (!owner.willDestroy.__ember_processes_destroyers__) {
    let oldWillDestroy = owner.willDestroy;
    let disposers = [];
    owner.willDestroy = function() {
      for (let i = 0, l = disposers.length; i < l; i++) {
        disposers[i]();
      }
      oldWillDestroy.apply(owner, arguments);
    };
    owner.willDestroy.__ember_processes_destroyers__ = disposers;
  }
  owner.willDestroy.__ember_processes_destroyers__.push(() => {
    try {
      object[cleanupMethodName]();
    } catch (err) {
      if (err.message !== 'TaskCancelation') {
        throw err;
      }
    }
  });
}
function cleanupOnDestroy ( owner , object , cleanupMethodName ) { if ( ! owner . willDestroy ) { return ; } if ( ! owner . willDestroy . __ember_processes_destroyers__ ) { let oldWillDestroy = owner . willDestroy ; let disposers = [ ] ; owner . willDestroy = function ( ) { for ( let i = 0 , l = disposers . length ; i < l ; i ++ ) { disposers [ i ] ( ) ; } oldWillDestroy . apply ( owner , arguments ) ; } ; owner . willDestroy . __ember_processes_destroyers__ = disposers ; } owner . willDestroy . __ember_processes_destroyers__ . push ( ( ) => { try { object [ cleanupMethodName ] ( ) ; } catch ( err ) { if ( err . message !== 'TaskCancelation' ) { throw err ; } } } ) ; }
cribbed from machty's ember-concurrency
cribbed from machty ' s ember - concurrency
// we're running in non Ember object (possibly in a test mock) /* eslint-disable-next-line @typescript-eslint/camelcase */