Closed F-park closed 8 months ago
问题出在第 70 行。 https://github.com/gaogaotiantian/biliscope/blob/8bf9e20ab3aefc306a26efc3602bcd9350542eb6/scripts/searchpage.js#L69-L79
https://github.com/gaogaotiantian/biliscope/blob/8bf9e20ab3aefc306a26efc3602bcd9350542eb6/scripts/searchpage.js#L37-L39
this.users 的类型是 Set,该类型获取长度的属性是 size 不是 length。
this.users
Set
size
length
所以 this.users.length 永远为 undefined,undefined == 0 永远为 false,第 70 行这段 if 代码永远不会执行。
this.users.length
undefined
undefined == 0
false
问题预览(修复前 -> 修复后)
问题代码
问题出在第 70 行。 https://github.com/gaogaotiantian/biliscope/blob/8bf9e20ab3aefc306a26efc3602bcd9350542eb6/scripts/searchpage.js#L69-L79
问题描述
https://github.com/gaogaotiantian/biliscope/blob/8bf9e20ab3aefc306a26efc3602bcd9350542eb6/scripts/searchpage.js#L37-L39
this.users
的类型是Set
,该类型获取长度的属性是size
不是length
。所以
this.users.length
永远为undefined
,undefined == 0
永远为false
,第 70 行这段 if 代码永远不会执行。