Skip to content

Commit cce0736

Browse files
committed
chore: fix JavaScript lint errors (issue #11559)
Replace three `new Array( len/8 )` + zero-fill-loop patterns with an empty array-literal plus `push` loop in `lib/node_modules/@stdlib/assert/has-sharedarraybuffer-support/test/test.js` to satisfy the `stdlib/no-new-array` rule. The Mock() helpers produce identical output; only the allocation strategy changes. Resolves #11559
1 parent 647a947 commit cce0736

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

  • lib/node_modules/@stdlib/assert/has-sharedarraybuffer-support/test

lib/node_modules/@stdlib/assert/has-sharedarraybuffer-support/test/test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ tape( 'if `SharedArrayBuffer` is supported, detection result is `true`', functio
6161
var out;
6262
var i;
6363

64-
out = new Array( len/8 ); // we assume evenly divisible
65-
for ( i = 0; i < out.length; i++ ) {
66-
out[ i ] = 0;
64+
out = [];
65+
for ( i = 0; i < len/8; i++ ) {
66+
out.push( 0 );
6767
}
6868
out.byteLength = len;
6969
out.slice = slice;
@@ -135,9 +135,9 @@ tape( 'if `SharedArrayBuffer` is not supported, detected result is `false` (no s
135135
var out;
136136
var i;
137137

138-
out = new Array( len/8 ); // we assume evenly divisible
139-
for ( i = 0; i < out.length; i++ ) {
140-
out[ i ] = 0;
138+
out = [];
139+
for ( i = 0; i < len/8; i++ ) {
140+
out.push( 0 );
141141
}
142142
out.byteLength = len;
143143
return out;
@@ -161,9 +161,9 @@ tape( 'if `SharedArrayBuffer` is not supported, detected result is `false` (no b
161161
var out;
162162
var i;
163163

164-
out = new Array( len/8 ); // we assume evenly divisible
165-
for ( i = 0; i < out.length; i++ ) {
166-
out[ i ] = 0;
164+
out = [];
165+
for ( i = 0; i < len/8; i++ ) {
166+
out.push( 0 );
167167
}
168168
out.slice = slice;
169169
return out;

0 commit comments

Comments
 (0)