Added polyfill for Array.findIndex() if missing
Bryan Roe committed
Aug 16, 2021 at 11:59 UTC
b58d7837a3afb29214623b565bd36cfd21b63727
1 file changed
+21
agents/recoverycore.js
+21
@@ -26,6 +26,27 @@ try
26
catch(x)
27
{
28
29
+}
30
+try
31
+{
32
+ Object.defineProperty(Array.prototype, 'findIndex', {
33
+ value: function (func)
34
+ {
35
+ var i = 0;
36
+ for (i = 0; i < this.length; ++i)
37
+ {
38
+ if (func(this[i], i, this))
39
+ {
40
+ return (i);
41
+ }
42
+ }
43
+ return (-1);
44
+ }
45
+ });
46
+}
47
+catch (x)
48
+{
49
+
50
}
51
52
if (process.platform != 'win32')