]> git.r.bdr.sh - rbdr/dotfiles/blob
5baf8a8d1127a4f9fce87382f6df95eaee6add12
[rbdr/dotfiles] /
1 'use strict';
2
3 var setPrototypeOf = require('../object/set-prototype-of')
4 , isExtensible = require('./_is-extensible');
5
6 module.exports = (function () {
7 var SubArray;
8
9 if (isExtensible) return require('./_sub-array-dummy');
10
11 if (!setPrototypeOf) return null;
12 SubArray = function () {
13 var arr = Array.apply(this, arguments);
14 setPrototypeOf(arr, SubArray.prototype);
15 return arr;
16 };
17 setPrototypeOf(SubArray, Array);
18 SubArray.prototype = Object.create(Array.prototype, {
19 constructor: { value: SubArray, enumerable: false, writable: true,
20 configurable: true }
21 });
22 return SubArray;
23 }());