Ember concurrency bug

Hey, there’s an issue with timeout function in utils.js after production build with target set to last 1 chrome version only.

For demo open console and go to https://cezaryh.github.io/ember-concurrency-utils-bug/

there’s bug in ember-concurrency/utils module in timeout function. After minification it looks like this:

e.timeout = function(e) { let t = new Ember.RSVP.Promise((t)=>{ n = Ember.run.later(t, e) }), n; return t.ec_cancel = ()=>{ Ember.run.cancel(n) } , t } which causes error “n is not defined”.

but the same code copied to other file (https://github.com/CezaryH/ember-concurrency-utils-bug/blob/master/app/utils.js) does not throw an error, and is minified differently

a.timeout = function(a) { let b, c = new Ember.RSVP.Promise(©=>{ b = Ember.run.later(c, a) }); return c.ec_cancel = ()=>{ Ember.run.cancel(b) } ,c } in this case “b” is defined

that happens when build target is “last 1 Chrome versions”


module.exports = { browsers: [ ‘last 1 Chrome versions’ ] };

I can’t figure out how to solve that, any ideas ?

that’s also posted in ember-concurrency github