From b58d7837a3afb29214623b565bd36cfd21b63727 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Mon, 16 Aug 2021 11:59:32 -0700 Subject: [PATCH] Added polyfill for Array.findIndex() if missing --- agents/recoverycore.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/agents/recoverycore.js b/agents/recoverycore.js index c2504bef..818b40eb 100644 --- a/agents/recoverycore.js +++ b/agents/recoverycore.js @@ -26,6 +26,27 @@ try catch(x) { +} +try +{ + Object.defineProperty(Array.prototype, 'findIndex', { + value: function (func) + { + var i = 0; + for (i = 0; i < this.length; ++i) + { + if (func(this[i], i, this)) + { + return (i); + } + } + return (-1); + } + }); +} +catch (x) +{ + } if (process.platform != 'win32')