added whole system from ola4doc

This commit is contained in:
Bachir Soussi Chiadmi
2017-12-14 17:06:06 +01:00
parent 9646c74be1
commit 0611418f7a
8725 changed files with 817688 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
'use strict';
if (!require('./is-implemented')()) {
Object.defineProperty(Array.prototype, 'fill', { value: require('./shim'),
configurable: true, enumerable: false, writable: true });
}
+4
View File
@@ -0,0 +1,4 @@
'use strict';
module.exports = require('./is-implemented')() ?
Array.prototype.fill : require('./shim');
+7
View File
@@ -0,0 +1,7 @@
'use strict';
module.exports = function () {
var arr = [1, 2, 3, 4, 5, 6];
if (typeof arr.fill !== 'function') return false;
return String(arr.fill(-1, -3)) === '1,2,3,-1,-1,-1';
};
+21
View File
@@ -0,0 +1,21 @@
// Taken from: https://github.com/paulmillr/es6-shim/
'use strict';
var toInteger = require('../../../number/to-integer')
, toPosInt = require('../../../number/to-pos-integer')
, validValue = require('../../../object/valid-value')
, max = Math.max, min = Math.min;
module.exports = function (value/*, start, end*/) {
var o = validValue(this), start = arguments[1], end = arguments[2]
, l = toPosInt(o.length), relativeStart, i;
start = (start === undefined) ? 0 : toInteger(start);
end = (end === undefined) ? l : toInteger(end);
relativeStart = start < 0 ? max(l + start, 0) : min(start, l);
for (i = relativeStart; i < l && i < end; ++i) o[i] = value;
return o;
};