mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-19 06:10:56 +08:00
fix: rollback animation lint which would break promise context
This commit is contained in:
@ -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;
|
||||||
|
Reference in New Issue
Block a user