Sha256: 1442cd55ceabe5191eb53437b2d1b86e26475d37d163f74ff14c91a740ad5bc3

Contents?: true

Size: 936 Bytes

Versions: 314

Compression:

Stored size: 936 Bytes

Contents

'use strict';
var $export    = require('./_export')
  , html       = require('./_html')
  , cof        = require('./_cof')
  , toIndex    = require('./_to-index')
  , toLength   = require('./_to-length')
  , arraySlice = [].slice;

// fallback for not array-like ES3 strings and DOM objects
$export($export.P + $export.F * require('./_fails')(function(){
  if(html)arraySlice.call(html);
}), 'Array', {
  slice: function slice(begin, end){
    var len   = toLength(this.length)
      , klass = cof(this);
    end = end === undefined ? len : end;
    if(klass == 'Array')return arraySlice.call(this, begin, end);
    var start  = toIndex(begin, len)
      , upTo   = toIndex(end, len)
      , size   = toLength(upTo - start)
      , cloned = Array(size)
      , i      = 0;
    for(; i < size; i++)cloned[i] = klass == 'String'
      ? this.charAt(start + i)
      : this[start + i];
    return cloned;
  }
});

Version data entries

314 entries across 6 versions & 1 rubygems

Version Path
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-function-name/node_modules/core-js/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-regex/node_modules/core-js/library/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-call-delegate/node_modules/core-js/library/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-function-name/node_modules/core-js/library/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-hoist-variables/node_modules/core-js/library/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-optimise-call-expression/node_modules/core-js/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-core/node_modules/core-js/library/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-generator/node_modules/core-js/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-define-map/node_modules/core-js/library/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-define-map/node_modules/core-js/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-get-function-arity/node_modules/core-js/library/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-get-function-arity/node_modules/core-js/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-hoist-variables/node_modules/core-js/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-optimise-call-expression/node_modules/core-js/library/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-code-frame/node_modules/core-js/library/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-code-frame/node_modules/core-js/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-core/node_modules/core-js/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-generator/node_modules/core-js/library/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-call-delegate/node_modules/core-js/modules/es6.array.slice.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-regex/node_modules/core-js/modules/es6.array.slice.js