diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-10-25 17:45:50 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-10-25 17:45:50 -0700 |
commit | 24f2b64781720ada9821bfd6eb8deddd72242dcb (patch) | |
tree | dd410c76b9c4c1ecb42c53ae51ee9bad8d96d2c9 /src | |
parent | 296cd5f54cb598fad7c9e58776bac906da1add02 (diff) |
do not mangle hex float constants in function calls
Diffstat (limited to 'src')
-rw-r--r-- | src/parseTools.js | 2 | ||||
-rw-r--r-- | src/utility.js | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 3489964f..455cbe8b 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -479,7 +479,7 @@ function parseParamTokens(params) { segment[0].text += segment[1].text; segment.splice(1, 1); // TODO: merge tokens nicely } - var num = isNumber(segment[1].text); + var num = isNumber(segment[1].text) || (segment[1].text[0] === '0'); // handle 0x... as well var ident = parseNumerical(segment[1].text, segment[0].text); if (!num) ident = toNiceIdent(ident); ret.push({ diff --git a/src/utility.js b/src/utility.js index ac821a89..62adb807 100644 --- a/src/utility.js +++ b/src/utility.js @@ -222,6 +222,7 @@ function mergeInto(obj, other) { } function isNumber(x) { + // XXX this does not handle 0xabc123 etc return x == parseFloat(x) || (typeof x == 'string' && x.match(/^-?\d+$/)); } |