Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@ var rule;

// FUNCTIONS //

/**
* Copies AST node location info.
*
* @private
* @param {Object} loc - AST node location
* @returns {Object} copied location info
*/
function copyLocationInfo( loc ) {
return {
'start': {
'line': loc.start.line,
'column': loc.start.column
},
'end': {
'line': loc.end.line,
'column': loc.end.column
}
};
}

/**
* Rule to prevent shortcut Markdown reference images from being used in JSDoc descriptions.
*
Expand Down Expand Up @@ -112,26 +132,6 @@ function main( context ) {
}
}

/**
* Copies AST node location info.
*
* @private
* @param {Object} loc - AST node location
* @returns {Object} copied location info
*/
function copyLocationInfo( loc ) {
return {
'start': {
'line': loc.start.line,
'column': loc.start.column
},
'end': {
'line': loc.end.line,
'column': loc.end.column
}
};
}

/**
* Reports an error message.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var resolve = require( 'path' ).resolve;
var readFile = require( '@stdlib/fs/read-file' ).sync;
var writeFile = require( '@stdlib/fs/write-file' ).sync;
var RE_EOL = require( '@stdlib/regexp/eol' ).REGEXP;
var format = require( '@stdlib/string/format' );


// VARIABLES //
Expand Down Expand Up @@ -66,7 +67,7 @@ function main() {
for ( i = 0; i < data.length; i++ ) {
d = data[ i ].split( ',' );
if ( d.length !== fields.length ) {
throw new Error( 'unexpected error. Number of row values ('+d.length+') does not match the expected number of fields ('+fields.length+').' );
throw new Error( format( 'unexpected error. Number of row values (%d) does not match the expected number of fields (%d).', d.length, fields.length ) );
}
for ( j = 1; j < d.length; j++ ) {
d[ j ] = parseFloat( d[ j ] );
Expand All @@ -86,7 +87,7 @@ function main() {
} else if ( d[ 0 ] === 'white' ) {
json.white.push( d[ 2 ] );
} else {
throw new Error( 'unexpected error. Unrecognized race: `'+d[2]+'`.' );
throw new Error( format( 'unexpected error. Unrecognized race: `%s`.', d[ 0 ] ) );
}
}
if ( json.black.length !== json.white.length ) {
Expand Down