Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Appcelerator 1.8 / V8 changes: getType needs a different Array check #17

Merged
merged 1 commit into from

2 participants

Nic Jansma Xavier Lacot
Nic Jansma

With Appcelerator 1.8 and V8 on Android, obj.constructor is [Function]. V8 has Array.isArray, so we can use that for V8.

Xavier Lacot xavierlacot merged commit 3cd90e7 into from
Xavier Lacot
Owner

Thanks nicjansma

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  joli.js
2  joli.js
View
@@ -38,7 +38,7 @@ var joli = {
getType: function(obj) {
if (typeof obj === "undefined" || obj === null || (typeof obj === "number" && isNaN(obj))) {
return false;
- } else if (obj.constructor === Array) {
+ } else if (obj.constructor === Array || (Array.isArray && Array.isArray(obj))) {
return "array";
} else {
return typeof obj;
Something went wrong with that request. Please try again.