Skip to content

Commit

Permalink
Unify error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Oct 26, 2015
1 parent 121e55b commit 5edcbf9
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions dist/long.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,19 @@
*/
Long.fromString = function fromString(str, unsigned, radix) {
if (str.length === 0)
throw Error('number format error: empty string');
throw Error('string is empty');
if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity")
return Long.ZERO;
if (typeof unsigned === 'number') // For goog.math.long compatibility
radix = unsigned,
unsigned = false;
radix = radix || 10;
if (radix < 2 || 36 < radix)
throw Error('radix out of range: ' + radix);
throw Error('radix out of range');

var p;
if ((p = str.indexOf('-')) > 0)
throw Error('number format error: interior "-" character: ' + str);
throw Error('interior hyphen');
else if (p === 0)
return Long.fromString(str.substring(1), unsigned, radix).neg();

Expand Down Expand Up @@ -393,7 +393,7 @@
LongPrototype.toString = function toString(radix) {
radix = radix || 10;
if (radix < 2 || 36 < radix)
throw RangeError('radix out of range: ' + radix);
throw RangeError('radix out of range');
if (this.isZero())
return '0';
var rem;
Expand Down
30 changes: 15 additions & 15 deletions dist/long.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/long.min.js.gz
Binary file not shown.
Loading

0 comments on commit 5edcbf9

Please sign in to comment.