Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions packages/sproutcore-runtime/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,29 +133,8 @@ SC.empty = function(obj) {
};

/**
@function

Returns YES if the passed object is an array or Array-like.

SproutCore Array Protocol:

- the object has an objectAt property
- the object is a native Array
- the object is an Object, and has a length property

Unlike SC.typeOf this method returns true even if the passed object is
not formally array but appears to be array-like (i.e. implements SC.Array)

@param {Object} obj The object to test
@returns {Boolean}
*/
SC.isArray = function(obj) {
if (!obj || obj.setInterval) { return false; }
if (Array.isArray && Array.isArray(obj)) { return true; }
if (SC.Array && SC.Array.detect(obj)) { return true; }
if ((obj.length !== undefined) && 'object'===typeof obj) { return true; }
return false;
};
SC.isArray defined in sproutcore-metal/lib/utils
**/

/**
This will compare two javascript values of possibly different types.
Expand Down