didi / mpx

Mpx,一款具有优秀开发体验和深度性能优化的增强型跨端小程序框架

Home Page:https://mpxjs.cn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug report] 使用setData更新数据时,某些场景会报错:TypeError: Cannot read property 'length' of null

vivine opened this issue · comments

问题描述

使用setData更新数据时,某些场景会报错:TypeError: Cannot read property 'length' of null

如下图:

image

具体代码关联为:

export function flushPreFlushCbs (seen, parentJob = null) {
if (pendingPreFlushCbs.length) {
currentPreFlushParentJob = parentJob
activePreFlushCbs = [...new Set(pendingPreFlushCbs)]
pendingPreFlushCbs.length = 0
if (isDev) seen = seen || new Map()
for (
preFlushIndex = 0;
preFlushIndex < activePreFlushCbs.length;
preFlushIndex++
) {
if (isDev && checkRecursiveUpdates(seen, activePreFlushCbs[preFlushIndex])) continue
activePreFlushCbs[preFlushIndex]()
}
activePreFlushCbs = null
preFlushIndex = 0
currentPreFlushParentJob = null
// recursively flush until it drains
flushPreFlushCbs(seen, parentJob)
}
}