Browse Source

src/parser.pegjs: Use radix in |parseInt| calls instead of "0x" prefix

Fixes the following JSHint errors:

  ./src/parser.js: line 2878, col 44, Missing radix parameter.
  ./src/parser.js: line 2949, col 44, Missing radix parameter.
redux
David Majda 10 years ago
parent
commit
67afc788ad
  1. 4
      src/parser.js
  2. 4
      src/parser.pegjs

4
src/parser.js

@ -2875,7 +2875,7 @@ PEG.parser = (function(){
}
if (result0 !== null) {
result0 = (function(h1, h2) {
return String.fromCharCode(parseInt("0x" + h1 + h2));
return String.fromCharCode(parseInt(h1 + h2, 16));
})(result0[1], result0[2]);
}
if (result0 === null) {
@ -2946,7 +2946,7 @@ PEG.parser = (function(){
}
if (result0 !== null) {
result0 = (function(h1, h2, h3, h4) {
return String.fromCharCode(parseInt("0x" + h1 + h2 + h3 + h4));
return String.fromCharCode(parseInt(h1 + h2 + h3 + h4, 16));
})(result0[1], result0[2], result0[3], result0[4]);
}
if (result0 === null) {

4
src/parser.pegjs

@ -298,12 +298,12 @@ zeroEscapeSequence
hexEscapeSequence
= "\\x" h1:hexDigit h2:hexDigit {
return String.fromCharCode(parseInt("0x" + h1 + h2));
return String.fromCharCode(parseInt(h1 + h2, 16));
}
unicodeEscapeSequence
= "\\u" h1:hexDigit h2:hexDigit h3:hexDigit h4:hexDigit {
return String.fromCharCode(parseInt("0x" + h1 + h2 + h3 + h4));
return String.fromCharCode(parseInt(h1 + h2 + h3 + h4, 16));
}
eolEscapeSequence

Loading…
Cancel
Save