提交 f6c2ea03 编写于 作者: L liwenzhen

add check setTimeout is function or not before invoking it to

Signed-off-by: Nliwenzhen <liwenzhen3@huawei.com>
Change-Id: Ia019597939e41a23fe1914cfbb7758fbe6f684f8
上级 3104153e
......@@ -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]) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册