From d0dc53c9867d0956a9f86acd5df781f64ba33680 Mon Sep 17 00:00:00 2001 From: Vinit Pandit Date: Wed, 27 Nov 2024 11:25:29 +0000 Subject: [PATCH 1/7] feat: add entries method in array/fixed-endian-factory/lib/main.js --- .../array/fixed-endian-factory/lib/main.js | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/lib/node_modules/@stdlib/array/fixed-endian-factory/lib/main.js b/lib/node_modules/@stdlib/array/fixed-endian-factory/lib/main.js index 3cb7a82e6997..8cb39dfaebd3 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-factory/lib/main.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-factory/lib/main.js @@ -875,6 +875,115 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli return out.join( ',' ); }); + /** + * Returns an iterator for iterating over array key-value pairs. + * + * @name entries + * @memberof TypedArray.prototype + * @type {Function} + * @throws {TypeError} `this` must be a complex number array + * @returns {Iterator} iterator + * + * @example + * var factory = require( '@stdlib/array/fixed-endian-factory' ); + * var int32arr = factory( 'int32' ); + * + * var arr = int32arr( 'little-endian', [ 1, 2, 3 ] ); + + * // Create an iterator: + * var it = arr.entries(); + * + * // Iterate over the key-value pairs... + * var v = it.next().value; + * // returns [ 0, 1 ] + * + * v = it.next().value; + * // returns [ 1, 2 ] + * + * v = it.next().value; + * // returns [ 2, 3 ] + * + * var bool = it.next().done; + * // returns true + */ + setReadOnly( TypedArray.prototype, 'entries', function entries() { + var length; + var self; + var isLe; + var FLAG; + var itr; + var buf; + var i; + if ( !isTypedArray( this ) ) { + throw new TypeError( format( 'invalid invocation. `this` is not %s %s.', CHAR2ARTICLE[ dtype[0] ], CTOR_NAME ) ); + } + self = this; + buf = this._buffer; + length = this._length; + isLe = this._isLE; + i = -1; + + itr = {}; + setReadOnly( itr, 'next', next ); + setReadOnly( itr, 'return', end ); + + if ( ITERATOR_SYMBOL ) { + setReadOnly( itr, ITERATOR_SYMBOL, factory); + } + return itr; + + /** + * Returns an iterator protocol-compliant object containing the next iterated value. + * + * @private + * @returns {Object} iterator protocol-compliant object + */ + function next() { + var val; + i += 1; + if ( FLAG || i >= length ) { + return { + 'done': true + }; + } + val = buf[ GETTER ]( i*BYTES_PER_ELEMENT, isLe ); + return { + 'value': [ i, val ], + 'done': false + }; + } + + /** + * Finishes an iterator. + * + * @private + * @param {*} [value] - value to return + * @returns {Object} iterator protocol-compliant object + */ + function end( value ) { + FLAG = true; + if ( arguments.length ) { + return { + 'value': value, + 'done': true + }; + } + return { + 'done': true + }; + } + + /** + * Returns a new iterator. + * + * @private + * @returns {Iterator} iterator + */ + function factory() { + return self.entries(); + } + }); + return TypedArray; /** From 357d02fc9eb8bd74508862df516c72b60d08c3cb Mon Sep 17 00:00:00 2001 From: Vinit Pandit Date: Wed, 27 Nov 2024 11:33:06 +0000 Subject: [PATCH 2/7] feat: add tests for entries method array/fixed-endian-factory/ --- .../fixed-endian-factory/test/test.entries.js | 241 ++++++++++++++++++ 1 file changed, 241 insertions(+) create mode 100644 lib/node_modules/@stdlib/array/fixed-endian-factory/test/test.entries.js diff --git a/lib/node_modules/@stdlib/array/fixed-endian-factory/test/test.entries.js b/lib/node_modules/@stdlib/array/fixed-endian-factory/test/test.entries.js new file mode 100644 index 000000000000..5d2f062d6f83 --- /dev/null +++ b/lib/node_modules/@stdlib/array/fixed-endian-factory/test/test.entries.js @@ -0,0 +1,241 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var proxyquire = require( 'proxyquire' ); +var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' ); +var isFunction = require( '@stdlib/assert/is-function' ); +var isArray = require( '@stdlib/assert/is-array' ); +var factory = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof factory, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the prototype of the returned function is an `entries` method', function test( t ) { + var ctor = factory( 'float64' ); + t.strictEqual( hasOwnProp( ctor.prototype, 'entries' ), true, 'returns expected value' ); + t.strictEqual( isFunction( ctor.prototype.at ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the method throws an error if invoked with a `this` context which is not a typed array instance', function test( t ) { + var values; + var ctor; + var arr; + var i; + + ctor = factory( 'float64' ); + arr = new ctor( 'little-endian', 5 ); + + values = [ + '5', + 5, + NaN, + true, + false, + null, + void 0, + {}, + [], + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + return arr.entries.call( value, 0 ); + }; + } +}); + +tape( 'the method returns an iterator protocol-compliant object', function test( t ) { + var ctor; + var arr; + var buf; + var it; + var v; + var i; + + buf = [ 1.0, 2.0, 3.0, 4.0, 5.0]; + ctor = factory( 'float64' ); + arr = new ctor( 'little-endian', buf); + + it = arr.entries(); + t.strictEqual( it.next.length, 0, 'has zero arity' ); + + for ( i = 0; i < arr.length; i++ ) { + v = it.next(); + t.strictEqual( isArray( v.value ), true, 'returns an array' ); + t.strictEqual( v.value[ 0 ], i, 'returns an index' ); + t.strictEqual( v.value[ 1 ], buf[ i ], 'returns expected value' ); + t.strictEqual( typeof v.done, 'boolean', 'returns a boolean' ); + } + t.end(); +}); + +tape( 'the method returns an iterator which has a `return` method for closing an iterator (no argument)', function test( t ) { + var ctor; + var arr; + var buf; + var it; + var v; + + buf = [ 1.0, 2.0, 3.0, 4.0, 5.0]; + ctor = factory( 'float64' ); + arr = new ctor( 'little-endian', buf); + + it = arr.entries(); + + v = it.next(); + t.strictEqual( v.value[ 1 ], buf[ 0 ], 'returns expected value' ); + t.strictEqual( v.done, false, 'returns expected value' ); + + v = it.next(); + t.strictEqual( v.value[ 1 ], buf[ 1 ], 'returns expected value' ); + t.strictEqual( v.done, false, 'returns expected value' ); + + v = it.return(); + t.strictEqual( v.value, void 0, 'returns expected value' ); + t.strictEqual( v.done, true, 'returns expected value' ); + + v = it.next(); + t.strictEqual( v.value, void 0, 'returns expected value' ); + t.strictEqual( v.done, true, 'returns expected value' ); + + v = it.next(); + t.strictEqual( v.value, void 0, 'returns expected value' ); + t.strictEqual( v.done, true, 'returns expected value' ); + + v = it.next(); + t.strictEqual( v.value, void 0, 'returns expected value' ); + t.strictEqual( v.done, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the method returns an iterator which has a `return` method for closing an iterator (argument)', function test( t ) { + var ctor; + var buf; + var arr; + var it; + var v; + + buf = [ 1.0, 2.0, 3.0, 4.0, 5.0]; + ctor = factory( 'float64' ); + arr = new ctor( 'little-endian', buf); + + it = arr.entries(); + + v = it.next(); + t.strictEqual( v.value[ 1 ], buf[ 0 ], 'returns expected value' ); + t.strictEqual( v.done, false, 'returns expected value' ); + + v = it.next(); + t.strictEqual( v.value[ 1 ], buf[ 1 ], 'returns expected value' ); + t.strictEqual( v.done, false, 'returns expected value' ); + + v = it.return( 'finished' ); + t.strictEqual( v.value, 'finished', 'returns expected value' ); + t.strictEqual( v.done, true, 'returns expected value' ); + + v = it.next(); + t.strictEqual( v.value, void 0, 'returns expected value' ); + t.strictEqual( v.done, true, 'returns expected value' ); + + v = it.next(); + t.strictEqual( v.value, void 0, 'returns expected value' ); + t.strictEqual( v.done, true, 'returns expected value' ); + + v = it.next(); + t.strictEqual( v.value, void 0, 'returns expected value' ); + t.strictEqual( v.done, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if an environment supports `Symbol.iterator`, the method returns an iterable', function test( t ) { + var factory; + var ctor; + var arr; + var buf; + var it1; + var it2; + var v1; + var v2; + var i; + + factory = proxyquire( './../lib/main.js', { + '@stdlib/symbol/iterator': '__ITERATOR_SYMBOL__' + }); + + buf = [ 1.0, 2.0, 3.0, 4.0, 5.0]; + ctor = factory( 'float64' ); + arr = new ctor( 'little-endian', buf); + + it1 = arr.entries(); + t.strictEqual( typeof it1[ '__ITERATOR_SYMBOL__' ], 'function', 'has method' ); + t.strictEqual( it1[ '__ITERATOR_SYMBOL__' ].length, 0, 'has zero arity' ); + + it2 = it1[ '__ITERATOR_SYMBOL__' ](); + t.strictEqual( typeof it2, 'object', 'returns an object' ); + t.strictEqual( typeof it2.next, 'function', 'has `next` method' ); + t.strictEqual( typeof it2.return, 'function', 'has `return` method' ); + + for ( i = 0; i < arr.length; i++ ) { + v1 = it1.next().value; + v2 = it2.next().value; + t.strictEqual( v1[ 0 ], v2[ 0 ], 'returns expected value' ); + t.strictEqual( v1[ 1 ], v2[ 1 ], 'returns expected value' ); + } + t.end(); +}); + +tape( 'if an environment does not support `Symbol.iterator`, the method does not return an "iterable"', function test( t ) { + var factory; + var ctor; + var arr; + var buf; + var it; + + factory = proxyquire( './../lib/main.js', { + '@stdlib/symbol/iterator': false + }); + + buf = [ 1.0, 2.0, 3.0, 4.0, 5.0]; + ctor = factory( 'float64' ); + arr = new ctor( 'little-endian', buf); + + it = arr.entries(); + t.strictEqual( it[ ITERATOR_SYMBOL ], void 0, 'does not have property' ); + + t.end(); +}); From 6f1c38152d5c3b9f78392f84c9c7618c1f8c0c43 Mon Sep 17 00:00:00 2001 From: Vinit Pandit Date: Wed, 27 Nov 2024 11:37:39 +0000 Subject: [PATCH 3/7] feat: add benchmarks for entries method of array/fixed-endian-factory --- .../benchmark/benchmark.entries.js | 53 ++++++++++ .../benchmark/benchmark.entries.length.js | 99 +++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.entries.js create mode 100644 lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.entries.length.js diff --git a/lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.entries.js b/lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.entries.js new file mode 100644 index 000000000000..8fe0f1c1a5e7 --- /dev/null +++ b/lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.entries.js @@ -0,0 +1,53 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2018 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var pkg = require( './../package.json' ).name; +var factory = require( './../lib' ); + + +// MAIN // + +bench( pkg+':entries:len=10', function benchmark( b ) { + var iter; + var arr; + var i; + + arr = new factory( 'int32' )( 'little-endian', 10 ); + for ( i = 0; i < 10; i++ ) { + arr.set( i, i ); + } + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + iter = arr.entries(); + if ( typeof iter !== 'object' ) { + b.fail( 'should return an object' ); + } + } + b.toc(); + if ( typeof iter !== 'object' || typeof iter.next !== 'function' ) { + b.fail( 'should return an iterator protocol-compliant object' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.entries.length.js b/lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.entries.length.js new file mode 100644 index 000000000000..91df88196dc5 --- /dev/null +++ b/lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.entries.length.js @@ -0,0 +1,99 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var pkg = require( './../package.json' ).name; +var factory = require( './../lib' ); + + +// VARIABLES // + +var Float64ArrayFE = factory( 'float64' ); + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var arr = new Float64ArrayFE( 'little-endian', len ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var itr; + var i; + + itr = arr.entries(); + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + itr.next(); + if ( arr.length !== len ) { + b.fail( 'should not change an array length' ); + } + } + b.toc(); + if ( arr.length !== len ) { + b.fail( 'should not change an array length' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( pkg+':every:len='+len, f ); + } +} + +main(); From d88ccc176bddb0ca117dca95f0e557221105183f Mon Sep 17 00:00:00 2001 From: Vinit Pandit Date: Wed, 27 Nov 2024 11:45:56 +0000 Subject: [PATCH 4/7] feat: add readme for entries method of array/fixed-endian-factory --- .../array/fixed-endian-factory/README.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/lib/node_modules/@stdlib/array/fixed-endian-factory/README.md b/lib/node_modules/@stdlib/array/fixed-endian-factory/README.md index 46e322fe4eed..63b548a23573 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-factory/README.md +++ b/lib/node_modules/@stdlib/array/fixed-endian-factory/README.md @@ -705,6 +705,60 @@ var str = arr.toString(); * * * + + +#### TypedArrayFE.prototype.entries() + +Return and iterator for iterating over array key-value pairs. + +```javascript +var factory = require( '@stdlib/array/fixed-endian-factory' ); +var int32arr = factory( 'int32' ); +var arr = int32arr( 'little-endian', [ 1, 2, 3, 4, 5 ] ); + +// Creat an iterator: +var itr = arr.entries(); + +// Iterate over the key-value pairs... +var v = itr.next().value; +// returns [ 0, 1 ]; + +var i = v[1]; +// returns 1; + +v = itr.next().value; +// returns [ 1, 2 ]; + +i = v[1]; +// returns 2; + +v = itr.next().value; +// returns [ 2, 3 ]; + +i = v[1]; +// returns 3; + +v = itr.next().value; +// returns [ 3, 4 ] + +i = v[1]; +// returns 4 + +v = itr.next().value; +// returns [ 4, 5 ]; + +i = v[1]; +// returns 5 + +var bool = itr.next().done; +// returns true +``` + +The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the following properties: + +- **next**: function which returns an [iterator][mdn-iterator-protocol] protocol-compliant object containing the next iterated value (if one exists) assigned to a `value` property and a `done` property having a `boolean` value indicating whether the [iterator][mdn-iterator-protocol] is finished. +- **return**: function which closes an [iterator][mdn-iterator-protocol] and returns a single (optional) argument in an [iterator][mdn-iterator-protocol] protocol-compliant object. + ## Notes - A returned constructor supports the following byte orders: @@ -782,6 +836,8 @@ logEach( '%s', out ); + From fe65d41548b72a09d908dc9ab5aa3acfbdb78d59 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:55:55 +0000 Subject: [PATCH 5/7] chore: update copyright years --- .../array/fixed-endian-factory/benchmark/benchmark.entries.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.entries.js b/lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.entries.js index 8fe0f1c1a5e7..f3c6a3e3a2ad 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.entries.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-factory/benchmark/benchmark.entries.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2018 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 91ef9fe6ac425246fa0fdce80a5a1156b2c369b3 Mon Sep 17 00:00:00 2001 From: Vinit Pandit Date: Mon, 9 Dec 2024 09:02:30 +0000 Subject: [PATCH 6/7] fix: fix spaces --- .../@stdlib/array/fixed-endian-factory/lib/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/array/fixed-endian-factory/lib/main.js b/lib/node_modules/@stdlib/array/fixed-endian-factory/lib/main.js index d418d3ff0c0d..3db0b54b2855 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-factory/lib/main.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-factory/lib/main.js @@ -1152,8 +1152,8 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli outbuf[ SETTER ]( index * BYTES_PER_ELEMENT, value, this._isLE ); return out; }); - - /** Returns an iterator for iterating over array key-value pairs. + + /** Returns an iterator for iterating over array key-value pairs. * * @name entries * @memberof TypedArray.prototype @@ -1259,7 +1259,7 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli function factory() { return self.entries(); } - }); + }); return TypedArray; From 2a510eabf33f0da1ab6320f6e489912b97a31821 Mon Sep 17 00:00:00 2001 From: Vinit Pandit <106718914+MeastroZI@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:36:40 +0530 Subject: [PATCH 7/7] fix: Clean ups Signed-off-by: Vinit Pandit <106718914+MeastroZI@users.noreply.github.com> --- .../@stdlib/array/fixed-endian-factory/README.md | 12 ++++++------ .../array/fixed-endian-factory/test/test.entries.js | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/node_modules/@stdlib/array/fixed-endian-factory/README.md b/lib/node_modules/@stdlib/array/fixed-endian-factory/README.md index 1eca8d2a6898..fb42266e1813 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-factory/README.md +++ b/lib/node_modules/@stdlib/array/fixed-endian-factory/README.md @@ -962,7 +962,7 @@ var v = out.get( 0 ); #### TypedArrayFE.prototype.entries() -Return and iterator for iterating over array key-value pairs. +Return an iterator for iterating over array as key-value pairs. ```javascript var factory = require( '@stdlib/array/fixed-endian-factory' ); @@ -976,31 +976,31 @@ var itr = arr.entries(); var v = itr.next().value; // returns [ 0, 1 ]; -var i = v[1]; +var i = v[ 1 ]; // returns 1; v = itr.next().value; // returns [ 1, 2 ]; -i = v[1]; +i = v[ 1 ]; // returns 2; v = itr.next().value; // returns [ 2, 3 ]; -i = v[1]; +i = v[ 1 ]; // returns 3; v = itr.next().value; // returns [ 3, 4 ] -i = v[1]; +i = v[ 1 ]; // returns 4 v = itr.next().value; // returns [ 4, 5 ]; -i = v[1]; +i = v[ 1 ]; // returns 5 var bool = itr.next().done; diff --git a/lib/node_modules/@stdlib/array/fixed-endian-factory/test/test.entries.js b/lib/node_modules/@stdlib/array/fixed-endian-factory/test/test.entries.js index 5d2f062d6f83..046e38f79df0 100644 --- a/lib/node_modules/@stdlib/array/fixed-endian-factory/test/test.entries.js +++ b/lib/node_modules/@stdlib/array/fixed-endian-factory/test/test.entries.js @@ -66,7 +66,7 @@ tape( 'the method throws an error if invoked with a `this` context which is not function noop() {} ]; for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] ); + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided '+values[ i ] ); } t.end(); @@ -230,9 +230,9 @@ tape( 'if an environment does not support `Symbol.iterator`, the method does not '@stdlib/symbol/iterator': false }); - buf = [ 1.0, 2.0, 3.0, 4.0, 5.0]; + buf = [ 1.0, 2.0, 3.0, 4.0, 5.0 ]; ctor = factory( 'float64' ); - arr = new ctor( 'little-endian', buf); + arr = new ctor( 'little-endian', buf ); it = arr.entries(); t.strictEqual( it[ ITERATOR_SYMBOL ], void 0, 'does not have property' );