]> git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/vim-mode/node_modules/grim/node_modules/emissary/node_modules/es6-weak-map/node_modules/es5-ext/array/#/splice/shim.js
a8505a2ce2a201e73c174ab702f209477dabe29a
[rbdr/dotfiles] / atom / packages / vim-mode / node_modules / grim / node_modules / emissary / node_modules / es6-weak-map / node_modules / es5-ext / array / # / splice / shim.js
1 'use strict';
2
3 var isPlainArray = require('../../is-plain-array')
4
5 , isArray = Array.isArray, splice = Array.prototype.splice
6 , forEach = Array.prototype.forEach;
7
8 module.exports = function (start, deleteCount/*, …items*/) {
9 var arr = splice.apply(this, arguments), result;
10 if (!this || !isArray(this) || isPlainArray(this)) return arr;
11 result = new this.constructor(arr.length);
12 forEach.call(arr, function (val, i) { result[i] = val; });
13 return result;
14 };