aboutsummaryrefslogtreecommitdiff
path: root/src/utility.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-06-03 14:40:15 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-06-03 14:40:15 -0700
commitcafdc3cca8493da19187880d99a32f021f706ce6 (patch)
treef66f482e8b4339382076d78d90ee83e3b21e2ae9 /src/utility.js
parent931418568a219a93f04606615ef6e5b24d639536 (diff)
refactoring in preparation for TYPED_ARRAYS==2 (disabled)
Diffstat (limited to 'src/utility.js')
-rw-r--r--src/utility.js8
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 = [];