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();
};
const _then = promise.then;
promise.then = function (...args) {
const r = _then(...args);
promise.then = function () {
// eslint-disable-next-line prefer-rest-params
const r = _then.apply(promise, arguments);
_this.fixupAnimationPromise(r);
return r;
};
const _catch = promise.catch;
promise.catch = function (...args) {
const r = _catch(...args);
promise.catch = function () {
// eslint-disable-next-line prefer-rest-params
const r = _catch.apply(promise, arguments);
_this.fixupAnimationPromise(r);
return r;