fix: rollback animation lint which would break promise context

This commit is contained in:
Martin Guillon
2020-11-12 21:03:33 +01:00
parent ca56a30d56
commit b85d0e5ee3

View File

@ -100,15 +100,17 @@ export abstract class AnimationBase implements AnimationBaseDefinition {
_this.cancel(); _this.cancel();
}; };
const _then = promise.then; const _then = promise.then;
promise.then = function (...args) { promise.then = function () {
const r = _then(...args); // eslint-disable-next-line prefer-rest-params
const r = _then.apply(promise, arguments);
_this.fixupAnimationPromise(r); _this.fixupAnimationPromise(r);
return r; return r;
}; };
const _catch = promise.catch; const _catch = promise.catch;
promise.catch = function (...args) { promise.catch = function () {
const r = _catch(...args); // eslint-disable-next-line prefer-rest-params
const r = _catch.apply(promise, arguments);
_this.fixupAnimationPromise(r); _this.fixupAnimationPromise(r);
return r; return r;