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 (ember-concurrency-utils-bug/utils.js at master · CezaryH/ember-concurrency-utils-bug · GitHub) does not throw an error, and is minified differently

a.timeout = function(a) { let b, c = new Ember.RSVP.Promise((c)=>{ 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”

config/targets.js

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