aboutsummaryrefslogtreecommitdiff
path: root/src/utility.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/utility.js')
-rw-r--r--src/utility.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utility.js b/src/utility.js
index ac821a89..bec0eb8f 100644
--- a/src/utility.js
+++ b/src/utility.js
@@ -222,7 +222,8 @@ function mergeInto(obj, other) {
}
function isNumber(x) {
- return x == parseFloat(x) || (typeof x == 'string' && x.match(/^-?\d+$/));
+ // XXX this does not handle 0xabc123 etc. We should likely also do x == parseInt(x) (which handles that), and remove hack |// handle 0x... as well|
+ return x == parseFloat(x) || (typeof x == 'string' && x.match(/^-?\d+$/)) || x === 'NaN';
}
function isArray(x) {