Commit 80243848 authored by GoshaZotov's avatar GoshaZotov

add Array.prototype.fill( Formulas tests error)

parent 23feac6c
......@@ -644,6 +644,48 @@ if (typeof Math.sign != 'function') {
};
}
if (!Array.prototype.fill) {
Array.prototype.fill = function(value) {
// Шаги 1-2.
if (this == null) {
throw new TypeError('this is null or not defined');
}
var O = Object(this);
// Шаги 3-5.
var len = O.length >>> 0;
// Шаги 6-7.
var start = arguments[1];
var relativeStart = start >> 0;
// Шаг 8.
var k = relativeStart < 0 ?
Math.max(len + relativeStart, 0) :
Math.min(relativeStart, len);
// Шаги 9-10.
var end = arguments[2];
var relativeEnd = end === undefined ?
len : end >> 0;
// Шаг 11.
var final = relativeEnd < 0 ?
Math.max(len + relativeEnd, 0) :
Math.min(relativeEnd, len);
// Шаг 12.
while (k < final) {
O[k] = value;
k++;
}
// Шаг 13.
return O;
};
}
RegExp.escape = function ( text ) {
return text.replace( /[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&" );
......
......@@ -2322,7 +2322,6 @@
return true;
}
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment