Skip to content

Commit 41a1812

Browse files
chore: fix JavaScript lint errors (issue #9812)
1 parent b3b438a commit 41a1812

2 files changed

Lines changed: 55 additions & 46 deletions

File tree

  • lib/node_modules/@stdlib
    • math/strided/special/besselj1-by/test
    • strided/common/examples/addon-napi-polymorphic

lib/node_modules/@stdlib/math/strided/special/besselj1-by/test/test.main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,17 @@ tape( 'the function computes the Bessel function of the first kind of order one
7474
besselj1By( x.length, x, 1, y, 1, accessor );
7575
t.deepEqual( y, expected, 'deep equal' );
7676

77-
x = new Array( 5 ); // sparse array
77+
x = [];
78+
x.length = 5; // sparse array
7879
y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
7980

8081
expected = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
8182

8283
besselj1By( x.length, x, 1, y, 1, accessor );
8384
t.deepEqual( y, expected, 'deep equal' );
8485

85-
x = new Array( 5 ); // sparse array
86+
x = [];
87+
x.length = 5; // sparse array
8688
x[ 2 ] = rand();
8789
y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
8890

Lines changed: 51 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,73 @@
11
/**
2-
* @license Apache-2.0
3-
*
4-
* Copyright (c) 2020 The Stdlib Authors.
5-
*
6-
* Licensed under the Apache License, Version 2.0 (the "License");
7-
* you may not use this file except in compliance with the License.
8-
* You may obtain a copy of the License at
9-
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
11-
*
12-
* Unless required by applicable law or agreed to in writing, software
13-
* distributed under the License is distributed on an "AS IS" BASIS,
14-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
* See the License for the specific language governing permissions and
16-
* limitations under the License.
17-
*/
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2020 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
1818

19-
'use strict';
19+
"use strict";
2020

21-
var join = require( 'path' ).join;
22-
var tryRequire = require( '@stdlib/utils/try-require' );
23-
var Float64Array = require( '@stdlib/array/float64' );
24-
var Float32Array = require( '@stdlib/array/float32' );
21+
var Float64Array = require("@stdlib/array/float64");
22+
var Float32Array = require("@stdlib/array/float32");
2523

24+
var add;
2625
// Try loading the add-on:
27-
var add = tryRequire( join( __dirname, 'addon.node' ) );
28-
26+
try {
27+
add = require("./addon.node");
28+
} catch (err) {
29+
add = err;
30+
}
2931
/**
30-
* Main execution sequence.
31-
*
32-
* @private
33-
*/
32+
* Main execution sequence.
33+
*
34+
* @private
35+
*/
3436
function main() {
3537
var x;
3638
var y;
3739
var z;
3840

39-
x = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] );
40-
y = new Float64Array( [ 5.0, 6.0, 7.0, 8.0, 9.0 ] );
41-
z = new Float64Array( x.length );
41+
x = new Float64Array([0.0, 1.0, 2.0, 3.0, 4.0]);
42+
y = new Float64Array([5.0, 6.0, 7.0, 8.0, 9.0]);
43+
z = new Float64Array(x.length);
4244

43-
add( 5, x, 1, y, 1, z, 1 );
45+
add(5, x, 1, y, 1, z, 1);
4446

45-
console.log( '' );
46-
console.log( 'Float64:' );
47-
console.log( z );
48-
console.log( '' );
47+
console.log("");
48+
console.log("Float64:");
49+
console.log(z);
50+
console.log("");
4951

50-
x = new Float32Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] );
51-
y = new Float32Array( [ 5.0, 6.0, 7.0, 8.0, 9.0 ] );
52-
z = new Float32Array( x.length );
52+
x = new Float32Array([0.0, 1.0, 2.0, 3.0, 4.0]);
53+
y = new Float32Array([5.0, 6.0, 7.0, 8.0, 9.0]);
54+
z = new Float32Array(x.length);
5355

54-
add( 5, x, 1, y, 1, z, 1 );
56+
add(5, x, 1, y, 1, z, 1);
5557

56-
console.log( 'Float32:' );
57-
console.log( z );
58-
console.log( '' );
58+
console.log("Float32:");
59+
console.log(z);
60+
console.log("");
5961
}
6062

61-
if ( add instanceof Error ) {
63+
if (add instanceof Error) {
6264
// Example compile command: /path/to/stdlib/node_modules/.bin/node-gyp rebuild
63-
console.error( 'Error: please make sure you have compiled the add-on before attempting to run this file. To compile the add-on, resolve the location of the `node-gyp` executable (e.g., `$PWD/.bin/node-gyp` from the root stdlib project directory), navigate to `%s`, and run `%s`.\n\nError: %s\n', __dirname, '/path/to/node-gyp rebuild', add.message );
65+
console.error(
66+
"Error: please make sure you have compiled the add-on before attempting to run this file. To compile the add-on, resolve the location of the `node-gyp` executable (e.g., `$PWD/.bin/node-gyp` from the root stdlib project directory), navigate to `%s`, and run `%s`.\n\nError: %s\n",
67+
__dirname,
68+
"/path/to/node-gyp rebuild",
69+
add.message,
70+
);
6471
} else {
6572
main();
6673
}

0 commit comments

Comments
 (0)