Skip to content

Commit f1e969c

Browse files
committed
Fix use of reserved word
1 parent 55fc38d commit f1e969c

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

tools/misc/stdlib-module-names/lib/async.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var MATCH = /\@stdlib/;
2525
* @throws {TypeError} must provide a function
2626
*
2727
* @example
28-
* async( onList );
28+
* list( onList );
2929
*
3030
* function onList( error, names ) {
3131
* if ( error ) {
@@ -34,7 +34,7 @@ var MATCH = /\@stdlib/;
3434
* console.dir( names );
3535
* }
3636
*/
37-
function async( clbk ) {
37+
function list( clbk ) {
3838
var opts;
3939
if ( !isFunction( clbk ) ) {
4040
throw new TypeError( 'invalid input argument. Must provide a function. Value: `' + clbk + '`.' );
@@ -49,9 +49,9 @@ function async( clbk ) {
4949
*
5050
* @private
5151
* @param {(Error|null)} error - error object
52-
* @param {StringArray} list - list of matching files
52+
* @param {StringArray} names - list of matching files
5353
*/
54-
function onGlob( error, list ) {
54+
function onGlob( error, names ) {
5555
var match;
5656
var name;
5757
var out;
@@ -60,19 +60,19 @@ function async( clbk ) {
6060
return clbk( error );
6161
}
6262
out = [];
63-
for ( i = 0; i < list.length; i++ ) {
64-
match = list[ i ].match( MATCH );
63+
for ( i = 0; i < names.length; i++ ) {
64+
match = names[ i ].match( MATCH );
6565
if ( match ) {
66-
name = list[ i ].substring( match.index );
66+
name = names[ i ].substring( match.index );
6767
name = dirname( name );
6868
out.push( name );
6969
}
7070
}
7171
clbk( null, out );
7272
} // end FUNCTION onGlob()
73-
} // end FUNCTION async()
73+
} // end FUNCTION list()
7474

7575

7676
// EXPORTS //
7777

78-
module.exports = async;
78+
module.exports = list;

tools/misc/stdlib-module-names/lib/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828

2929
var stdlib = require( './stdlib.js' );
3030
var setReadOnly = require( stdlib+'@stdlib/utils/define-read-only-property' );
31-
var async = require( './async.js' );
31+
var list = require( './async.js' );
3232
var sync = require( './sync.js' );
3333

3434

3535
// METHODS //
3636

37-
setReadOnly( async, 'sync', sync );
37+
setReadOnly( list, 'sync', sync );
3838

3939

4040
// EXPORTS //
4141

42-
module.exports = async;
42+
module.exports = list;

tools/misc/stdlib-module-names/lib/sync.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,42 @@ var ROOT = path.resolve( __dirname, stdlib );
1515
var MATCH = /\@stdlib/;
1616

1717

18-
// SYNC //
18+
// LIST //
1919

2020
/**
2121
* Synchronously generates a list of stdlib module names.
2222
*
2323
* @returns {StringArray} list of names
2424
*
2525
* @example
26-
* var names = sync();
26+
* var names = list();
2727
* // returns [...]
2828
*/
29-
function sync() {
29+
function list() {
3030
var match;
31+
var names;
3132
var name;
3233
var opts;
33-
var list;
3434
var out;
3535
var i;
3636

3737
opts = {
3838
'cwd': ROOT
3939
};
40-
list = glob( PATTERN, opts );
40+
names = glob( PATTERN, opts );
4141
out = [];
42-
for ( i = 0; i < list.length; i++ ) {
43-
match = list[ i ].match( MATCH );
42+
for ( i = 0; i < names.length; i++ ) {
43+
match = names[ i ].match( MATCH );
4444
if ( match ) {
45-
name = list[ i ].substring( match.index );
45+
name = names[ i ].substring( match.index );
4646
name = dirname( name );
4747
out.push( name );
4848
}
4949
}
5050
return out;
51-
} // end FUNCTION sync()
51+
} // end FUNCTION list()
5252

5353

5454
// EXPORTS //
5555

56-
module.exports = sync;
56+
module.exports = list;

0 commit comments

Comments
 (0)