util: remove unreachable branch
Re-defining the array length will always set to 0. Hence, the code branch can not be covered. PR-URL: https://github.com/nodejs/node/pull/24447 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
b32c5f0408
commit
fbc29164ea
@ -475,7 +475,7 @@ function noPrototypeIterator(ctx, value, recurseTimes) {
|
||||
} else if (Array.isArray(value)) {
|
||||
const clazz = Object.getPrototypeOf(value) ||
|
||||
clazzWithNullPrototype(Array, 'Array');
|
||||
newVal = new clazz(value.length || 0);
|
||||
newVal = new clazz(value.length);
|
||||
} else if (isTypedArray(value)) {
|
||||
let clazz = Object.getPrototypeOf(value);
|
||||
if (!clazz) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user