mirror of
https://github.com/openharmony/third_party_jsframework.git
synced 2026-07-18 12:35:31 -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;
|
||||
|
||||
// Use setTimeout instead of setTimeoutDiffer
|
||||
setTimeout(() => {
|
||||
this._hasTimer = false;
|
||||
this.flush();
|
||||
}, 0);
|
||||
// avoid invoking setTimeout after appDestroy
|
||||
if (typeof setTimeout === "function") {
|
||||
setTimeout(() => {
|
||||
this._hasTimer = false;
|
||||
this.flush();
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
const map: object[] = this._map;
|
||||
if (!map[defaultDepth]) {
|
||||
|
||||
Reference in New Issue
Block a user