fix(runtime-core): ensure consistent behavior between dev/prod on invalid v-for range
close #5867
This commit is contained in:
parent
4e7b36f5c3
commit
67099fe202
@ -22,7 +22,9 @@ describe('renderList', () => {
|
||||
})
|
||||
|
||||
it('should warn when given a non-integer N', () => {
|
||||
renderList(3.1, () => {})
|
||||
try {
|
||||
renderList(3.1, () => {})
|
||||
} catch (e) {}
|
||||
expect(
|
||||
`The v-for range expect an integer value but got 3.1.`
|
||||
).toHaveBeenWarned()
|
||||
|
@ -67,7 +67,6 @@ export function renderList(
|
||||
} else if (typeof source === 'number') {
|
||||
if (__DEV__ && !Number.isInteger(source)) {
|
||||
warn(`The v-for range expect an integer value but got ${source}.`)
|
||||
return []
|
||||
}
|
||||
ret = new Array(source)
|
||||
for (let i = 0; i < source; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user