Sha256: 5f75177d203e7f91973d22f963fee7935d88bab93eba795d274e99b827324ddd

Contents?: true

Size: 846 Bytes

Versions: 40

Compression:

Stored size: 846 Bytes

Contents

// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
'use strict';
var toObject = require('./$.to-object')
  , toIndex  = require('./$.to-index')
  , toLength = require('./$.to-length');

module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){
  var O     = toObject(this)
    , len   = toLength(O.length)
    , to    = toIndex(target, len)
    , from  = toIndex(start, len)
    , $$    = arguments
    , end   = $$.length > 2 ? $$[2] : undefined
    , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to)
    , inc   = 1;
  if(from < to && to < from + count){
    inc  = -1;
    from += count - 1;
    to   += count - 1;
  }
  while(count-- > 0){
    if(from in O)O[to] = O[from];
    else delete O[to];
    to   += inc;
    from += inc;
  } return O;
};

Version data entries

40 entries across 18 versions & 7 rubygems

Version Path
ilog-0.4.1 node_modules/core-js/modules/$.array-copy-within.js
ilog-0.4.1 node_modules/core-js/library/modules/$.array-copy-within.js
ilog-0.4.0 node_modules/core-js/modules/$.array-copy-within.js
ilog-0.4.0 node_modules/core-js/library/modules/$.array-copy-within.js
ilog-0.3.3 node_modules/core-js/modules/$.array-copy-within.js
ilog-0.3.3 node_modules/core-js/library/modules/$.array-copy-within.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/fbjs/node_modules/core-js/library/modules/$.array-copy-within.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/fbjs/node_modules/core-js/modules/$.array-copy-within.js
locomotivecms-3.4.0 app/javascript/node_modules/fbjs/node_modules/core-js/modules/$.array-copy-within.js
locomotivecms-3.4.0 app/javascript/node_modules/fbjs/node_modules/core-js/library/modules/$.array-copy-within.js
cortex-0.1.3 spec/dummy/node_modules/fbjs/node_modules/core-js/library/modules/$.array-copy-within.js
cortex-0.1.3 spec/dummy/node_modules/fbjs/node_modules/core-js/modules/$.array-copy-within.js
lanes-0.8.0 node_modules/core-js/library/modules/$.array-copy-within.js
lanes-0.8.0 node_modules/core-js/modules/$.array-copy-within.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/core-js/modules/$.array-copy-within.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/core-js/library/modules/$.array-copy-within.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/core-js/modules/$.array-copy-within.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/core-js/library/modules/$.array-copy-within.js
babel-schmooze-sprockets-0.1.3 node_modules/core-js/modules/$.array-copy-within.js
babel-schmooze-sprockets-0.1.3 node_modules/core-js/library/modules/$.array-copy-within.js