diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-11-10 13:26:35 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-11-10 13:26:35 -0800 |
commit | bbefb9fb22982d5ed712f8eb9664fef8d278c4b1 (patch) | |
tree | 865a674897e7a82e935129ba20d600db375e33dc /src | |
parent | 4afd9490f5eae1ec1b6491232778c57cb417aeb0 (diff) |
i64 fixes and tests
Diffstat (limited to 'src')
-rw-r--r-- | src/parseTools.js | 5 | ||||
-rw-r--r-- | src/utility.js | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 40f845a3..c8b4b918 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -359,6 +359,9 @@ function finalizeParam(param) { } else if (param.intertype === 'jsvalue') { return param.ident; } else { + if (param.type == 'i64' && I64_MODE == 1) { + return parseI64Constant(param.ident); + } return toNiceIdent(param.ident); } } @@ -526,7 +529,7 @@ function IEEEUnHex(stringy) { return (absolute * (neg ? -1 : 1)).toString(); } -// Makes a proper runtime value for a 64-bit value. Used in library. +// Makes a proper runtime value for a 64-bit value from low and high i32s. function makeI64(low, high) { if (I64_MODE == 1) { return '[' + low + ',' + (high || '0') + ']'; diff --git a/src/utility.js b/src/utility.js index 42c6ca69..5ae4480f 100644 --- a/src/utility.js +++ b/src/utility.js @@ -185,7 +185,7 @@ function mergeInto(obj, other) { } function isNumber(x) { - return x == parseFloat(x); // XXX add: || x.match(/^-?\d+(\.\d+)?/); + return x == parseFloat(x) || (typeof x == 'string' && x.match(/^-?\d+/)); } function isArray(x) { |