Skip to content

Commit 0265fb5

Browse files
committed
Merge branch 'develop' into feat/gammainc-c
2 parents f052817 + bbac3f9 commit 0265fb5

File tree

125 files changed

+12137
-19
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+12137
-19
lines changed

lib/node_modules/@stdlib/_tools/eslint/rules/first-unit-test/lib/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ function main( context ) {
7676
hasMainExportTest = false;
7777
tOkExists = false;
7878
filename = context.getFilename();
79-
if ( contains( filename, 'test.' ) && !contains( filename, 'fixtures' ) ) {
79+
if (
80+
contains( filename, '/test/' ) &&
81+
contains( filename, 'test.' ) &&
82+
!contains( filename, 'fixtures' )
83+
) {
8084
if ( endsWith( filename, 'cli.js' ) ) {
8185
forCLI = true;
8286
}

lib/node_modules/@stdlib/dstructs/struct/lib/get_bigint.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ function getBigInt( obj, method ) {
4646
* @returns {BigInt} result
4747
*/
4848
function getter() {
49-
return this[ PRIVATE_BUFFER ][ method ]( obj.byteOffset, IS_LITTLE_ENDIAN ); // eslint-disable-line max-len
49+
var view = this[ PRIVATE_BUFFER ];
50+
return view[ method ]( obj.byteOffset, IS_LITTLE_ENDIAN );
5051
}
5152
}
5253

lib/node_modules/@stdlib/dstructs/struct/lib/get_boolean.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ function getBoolean( obj, method ) {
4747
* @returns {boolean} result
4848
*/
4949
function getter() {
50-
return Boolean( this[ PRIVATE_BUFFER ][ method ]( obj.byteOffset, IS_LITTLE_ENDIAN ) ); // eslint-disable-line max-len
50+
var view = this[ PRIVATE_BUFFER ];
51+
return Boolean( view[ method ]( obj.byteOffset, IS_LITTLE_ENDIAN ) );
5152
}
5253
}
5354

lib/node_modules/@stdlib/dstructs/struct/lib/get_complex.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ function getComplex( obj, method ) {
5656
* @returns {Complex} result
5757
*/
5858
function getter() {
59-
var re = this[ PRIVATE_BUFFER ][ method ]( obj.byteOffset, IS_LITTLE_ENDIAN );
60-
var im = this[ PRIVATE_BUFFER ][ method ]( obj.byteOffset+(obj.byteLength/2), IS_LITTLE_ENDIAN );
59+
var view = this[ PRIVATE_BUFFER ];
60+
var re = view[ method ]( obj.byteOffset, IS_LITTLE_ENDIAN );
61+
var im = view[ method ]( obj.byteOffset+(obj.byteLength/2), IS_LITTLE_ENDIAN );
6162
return complex( re, im, CMPLX_TO_REAL[ obj.type ] );
6263
}
6364
}

lib/node_modules/@stdlib/dstructs/struct/lib/get_number.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ function getNumber( obj, method ) {
4646
* @returns {number} result
4747
*/
4848
function getter() {
49-
return this[ PRIVATE_BUFFER ][ method ]( obj.byteOffset, IS_LITTLE_ENDIAN ); // eslint-disable-line max-len
49+
var view = this[ PRIVATE_BUFFER ];
50+
return view[ method ]( obj.byteOffset, IS_LITTLE_ENDIAN );
5051
}
5152
}
5253

lib/node_modules/@stdlib/dstructs/struct/lib/main.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var isCollection = require( '@stdlib/assert/is-collection' );
2929
var isArrayBuffer = require( '@stdlib/assert/is-arraybuffer' );
3030
var isObject = require( '@stdlib/assert/is-object' );
3131
var hasProp = require( '@stdlib/assert/has-property' );
32+
var min = require( '@stdlib/math/base/special/fast/min' );
3233
var join = require( '@stdlib/array/base/join' );
3334
var filled = require( '@stdlib/array/base/filled' );
3435
var indexOf = require( '@stdlib/array/base/index-of' );
@@ -152,7 +153,7 @@ function factory( fields ) {
152153
* @private
153154
* @param {(Object|ArrayBuffer)} [arg] - array buffer or data object
154155
* @param {NonNegativeInteger} [byteOffset=0] - offset, in bytes, to the first byte in a provided buffer for the returned `struct` to reference
155-
* @param {NonNegativeInteger} [byteLength] - number of elements in the byte array
156+
* @param {NonNegativeInteger} [byteLength] - maximum number of elements in the byte array
156157
* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements
157158
* @throws {TypeError} second argument must be a nonnegative integer
158159
* @throws {TypeError} third argument must be a nonnegative integer
@@ -186,18 +187,18 @@ function factory( fields ) {
186187
}
187188
if ( isArrayBuffer( arg ) ) {
188189
if ( nargs === 1 ) {
189-
view = new DataView( arg );
190+
view = new DataView( arg, 0, BYTE_LENGTH );
190191
} else {
191192
if ( !isNonNegativeInteger( byteOffset ) ) {
192193
throw new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );
193194
}
194195
if ( nargs === 2 ) {
195-
view = new DataView( arg, byteOffset );
196+
view = new DataView( arg, byteOffset, BYTE_LENGTH );
196197
} else {
197198
if ( !isNonNegativeInteger( byteLength ) ) {
198199
throw new TypeError( format( 'invalid argument. Byte length must be a nonnegative integer. Value: `%s`.', byteLength ) );
199200
}
200-
view = new DataView( arg, byteOffset, byteLength );
201+
view = new DataView( arg, byteOffset, min( byteLength, BYTE_LENGTH ) ); // eslint-disable-line max-len
201202
}
202203
}
203204
if ( view.byteLength < BYTE_LENGTH ) {

lib/node_modules/@stdlib/dstructs/struct/lib/set_bigint.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ function setBigInt( obj, method ) {
6161
* @throws {TypeError} cannot cast provided values to field data type
6262
*/
6363
function setter( value ) {
64+
var view;
6465
var dt;
6566
var v;
66-
6767
if ( isBigInt( value ) ) {
6868
dt = 'int64'; // FIXME: support both int64 and uint64
6969
v = value;
@@ -88,7 +88,8 @@ function setBigInt( obj, method ) {
8888
if ( !isAllowedCast( dt, obj.type, obj.castingMode ) ) {
8989
throw new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].', obj.name, obj.type, dt ) );
9090
}
91-
this[ PRIVATE_BUFFER ][ method ]( obj.byteOffset, v, IS_LITTLE_ENDIAN );
91+
view = this[ PRIVATE_BUFFER ];
92+
view[ method ]( obj.byteOffset, v, IS_LITTLE_ENDIAN );
9293
}
9394
}
9495

lib/node_modules/@stdlib/dstructs/struct/lib/set_boolean.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ function setBoolean( obj, method ) {
6060
* @throws {TypeError} cannot cast provided values to field data type
6161
*/
6262
function setter( value ) {
63+
var view;
6364
var dt;
6465
var v;
6566
if ( isBoolean( value ) ) {
@@ -81,7 +82,8 @@ function setBoolean( obj, method ) {
8182
if ( !isAllowedCast( dt, obj.type, obj.castingMode ) ) {
8283
throw new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].', obj.name, obj.type, dt ) );
8384
}
84-
this[ PRIVATE_BUFFER ][ method ]( obj.byteOffset, v, IS_LITTLE_ENDIAN );
85+
view = this[ PRIVATE_BUFFER ];
86+
view[ method ]( obj.byteOffset, v, IS_LITTLE_ENDIAN );
8587
}
8688
}
8789

lib/node_modules/@stdlib/dstructs/struct/lib/set_complex.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ function setComplex( obj, method ) {
5656
* @throws {TypeError} cannot cast provided values to field data type
5757
*/
5858
function setter( value ) {
59+
var view;
5960
var dt;
6061
var re;
6162
var im;
62-
6363
if ( isComplexLike( value ) ) {
6464
dt = complexDType( value ) || obj.type;
6565
re = value.re;
@@ -84,8 +84,9 @@ function setComplex( obj, method ) {
8484
if ( !isAllowedCast( dt, obj.type, obj.castingMode ) ) {
8585
throw new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].', obj.name, obj.type, dt ) );
8686
}
87-
this[ PRIVATE_BUFFER ][ method ]( obj.byteOffset, re, IS_LITTLE_ENDIAN );
88-
this[ PRIVATE_BUFFER ][ method ]( obj.byteOffset+(obj.byteLength/2), im, IS_LITTLE_ENDIAN );
87+
view = this[ PRIVATE_BUFFER ];
88+
view[ method ]( obj.byteOffset, re, IS_LITTLE_ENDIAN );
89+
view[ method ]( obj.byteOffset+(obj.byteLength/2), im, IS_LITTLE_ENDIAN );
8990
}
9091
}
9192

lib/node_modules/@stdlib/dstructs/struct/lib/set_number.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ function setNumber( obj, method ) {
6262
* @throws {TypeError} cannot cast provided values to field data type
6363
*/
6464
function setter( value ) {
65+
var view;
6566
var dt;
6667
var v;
6768
if ( isNumber( value ) ) {
@@ -91,7 +92,8 @@ function setNumber( obj, method ) {
9192
if ( !isAllowedCast( dt, obj.type, obj.castingMode ) ) {
9293
throw new TypeError( format( 'invalid assignment. Assigned value cannot be cast to the data type of `%s`. Data types: [%s, %s].', obj.name, obj.type, dt ) );
9394
}
94-
this[ PRIVATE_BUFFER ][ method ]( obj.byteOffset, v, IS_LITTLE_ENDIAN );
95+
view = this[ PRIVATE_BUFFER ];
96+
view[ method ]( obj.byteOffset, v, IS_LITTLE_ENDIAN );
9597
}
9698
}
9799

0 commit comments

Comments
 (0)