mirror of
https://github.com/openharmony/third_party_jsframework.git
synced 2026-07-19 22:43:32 -04:00
add check setTimeout is function or not before invoking it to
Signed-off-by: liwenzhen <liwenzhen3@huawei.com> Change-Id: Ia019597939e41a23fe1914cfbb7758fbe6f684f8
This commit is contained in:
@@ -63,10 +63,13 @@ export default class Differ {
|
|||||||
this._hasTimer = true;
|
this._hasTimer = true;
|
||||||
|
|
||||||
// Use setTimeout instead of setTimeoutDiffer
|
// Use setTimeout instead of setTimeoutDiffer
|
||||||
setTimeout(() => {
|
// avoid invoking setTimeout after appDestroy
|
||||||
this._hasTimer = false;
|
if (typeof setTimeout === "function") {
|
||||||
this.flush();
|
setTimeout(() => {
|
||||||
}, 0);
|
this._hasTimer = false;
|
||||||
|
this.flush();
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const map: object[] = this._map;
|
const map: object[] = this._map;
|
||||||
if (!map[defaultDepth]) {
|
if (!map[defaultDepth]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user