Skip to content

Commit 8b666d6

Browse files
TrottMylesBorins
authored andcommitted
test: reduce scope of variable in common module
arrayBufferViews is used by only one function so scope it to that function (in the common module). PR-URL: #17830 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 1be0086 commit 8b666d6

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

test/common/index.js

+14-13
Original file line numberDiff line numberDiff line change
@@ -788,23 +788,24 @@ exports.skipIf32Bits = function skipIf32Bits() {
788788
}
789789
};
790790

791-
const arrayBufferViews = [
792-
Int8Array,
793-
Uint8Array,
794-
Uint8ClampedArray,
795-
Int16Array,
796-
Uint16Array,
797-
Int32Array,
798-
Uint32Array,
799-
Float32Array,
800-
Float64Array,
801-
DataView
802-
];
803-
804791
exports.getArrayBufferViews = function getArrayBufferViews(buf) {
805792
const { buffer, byteOffset, byteLength } = buf;
806793

807794
const out = [];
795+
796+
const arrayBufferViews = [
797+
Int8Array,
798+
Uint8Array,
799+
Uint8ClampedArray,
800+
Int16Array,
801+
Uint16Array,
802+
Int32Array,
803+
Uint32Array,
804+
Float32Array,
805+
Float64Array,
806+
DataView
807+
];
808+
808809
for (const type of arrayBufferViews) {
809810
const { BYTES_PER_ELEMENT = 1 } = type;
810811
if (byteLength % BYTES_PER_ELEMENT === 0) {

0 commit comments

Comments
 (0)