diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-06-03 14:40:15 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-06-03 14:40:15 -0700 |
commit | cafdc3cca8493da19187880d99a32f021f706ce6 (patch) | |
tree | f66f482e8b4339382076d78d90ee83e3b21e2ae9 /src/utility.js | |
parent | 931418568a219a93f04606615ef6e5b24d639536 (diff) |
refactoring in preparation for TYPED_ARRAYS==2 (disabled)
Diffstat (limited to 'src/utility.js')
-rw-r--r-- | src/utility.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utility.js b/src/utility.js index 2fb18e0d..7ab9e1ed 100644 --- a/src/utility.js +++ b/src/utility.js @@ -188,6 +188,14 @@ function isNumber(x) { return x == parseFloat(x); } +function isArray(x) { + try { + return typeof x === 'object' && 'length' in x && 'slice' in x; + } catch(e) { + return false; + } +} + function flatten(x) { if (typeof x !== 'object') return x; var ret = []; |