From 67afc788add5a2e3960885d703dcaf4619246a77 Mon Sep 17 00:00:00 2001 From: David Majda Date: Wed, 14 Sep 2011 10:39:34 +0200 Subject: [PATCH] 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. --- src/parser.js | 4 ++-- src/parser.pegjs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/parser.js b/src/parser.js index 14c1279..8b8c3ca 100644 --- a/src/parser.js +++ b/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) { diff --git a/src/parser.pegjs b/src/parser.pegjs index 414c6c3..bdfb6b4 100644 --- a/src/parser.pegjs +++ b/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