File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change 292292
293293 // taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js
294294 // can be replaced with require('is-arguments') if we ever use a build process instead
295- var isArguments = function isArguments ( value ) {
296- var str = _toString ( value ) ;
297- var result = str === '[object Arguments]' ;
298- if ( ! result ) {
299- result = str !== '[object Array]' &&
300- value !== null &&
301- typeof value === 'object' &&
302- typeof value . length === 'number' &&
303- value . length >= 0 &&
304- _toString ( value . callee ) === '[object Function]' ;
305- }
306- return result ;
295+ var isStandardArguments = function isArguments ( value ) {
296+ return _toString ( value ) === '[object Arguments]' ;
297+ } ;
298+ var isLegacyArguments = function isArguments ( value ) {
299+ return value !== null &&
300+ typeof value === 'object' &&
301+ typeof value . length === 'number' &&
302+ value . length >= 0 &&
303+ _toString ( vaue ) !== '[object Array]' &&
304+ _toString ( value . callee ) === '[object Function]' ;
307305 } ;
306+ var isArguments = isStandardArguments ( arguments ) ? isStandardArguments : isLegacyArguments ;
308307
309308 var ES = {
310309 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-call-f-v-args
You can’t perform that action at this time.
0 commit comments