Skip to content

Commit

Permalink
isArguments method
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Feb 14, 2014
1 parent d2390a2 commit 69857e9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions es6-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@
defineProperties(prototype, o);
};

// taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js
// can be replaced with require('is-arguments') if we ever use a build process instead
var isArguments = function isArguments(value) {
var str = _toString.call(value);
var isArguments = str === '[object Arguments]';
if (!isArguments) {
isArguments = str !== '[object Array]'
&& value !== null
&& typeof value === 'object'
&& typeof value.length === 'number'
&& value.length >= 0
&& toString.call(value.callee) === '[object Function]';
}
return isArguments;
};

var ES = {
CheckObjectCoercible: function(x, optMessage) {
if (x == null)
Expand Down

0 comments on commit 69857e9

Please sign in to comment.