mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
util: throw if unreachable TypedArray checking code is reached
If a comparison code path that is supposed to be unreachable is reached, throw. Add a c8 comment to ignore coverage for the line, as it should be unreachable. PR-URL: https://github.com/nodejs/node/pull/31737 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
committed by
Anna Henningsen
parent
481fa1ca98
commit
a18b437e6a
@@ -147,7 +147,11 @@ function isIdenticalTypedArrayType(a, b) {
|
||||
return check(b);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
/* c8 ignore next */
|
||||
assert.fail(
|
||||
`Unknown TypedArray type checking ${a[SymbolToStringTag]} ${a}\n` +
|
||||
`and ${b[SymbolToStringTag]} ${b}`
|
||||
);
|
||||
}
|
||||
|
||||
// Notes: Type tags are historical [[Class]] properties that can be set by
|
||||
|
||||
Reference in New Issue
Block a user