#1358 Add findLastIndex polyfill for old Safari
| @@ -6479,8 +6479,8 @@ | ||
| 6479 | 6479 | </div> |
| 6480 | 6480 | |
| 6481 | 6481 | <!-- Script includes --> |
| 6482 | + <script src="lib/polyfill.js"></script> | |
| 6482 | 6483 | <script src="lib/diff_match_patch.js"></script> |
| 6483 | - <script src="lib/object-hasown.js"></script> | |
| 6484 | 6484 | <script src="lib/jquery-3.5.1.min.js"></script> |
| 6485 | 6485 | <script src="lib/jquery-ui.min.js"></script> |
| 6486 | 6486 | <script src="lib/jquery.transit.min.js"></script> |
| @@ -1,4 +0,0 @@ | ||
| 1 | -// Polyfill for old Safari versions | |
| 2 | -if (!Object.hasOwn) { | |
| 3 | - Object.hasOwn = function (obj, prop) { return obj.hasOwnProperty(prop); } | |
| 4 | -} | |
| @@ -0,0 +1,13 @@ | ||
| 1 | +// Polyfills for old Safari versions | |
| 2 | +if (!Object.hasOwn) { | |
| 3 | + Object.hasOwn = function (obj, prop) { return obj.hasOwnProperty(prop); } | |
| 4 | +} | |
| 5 | + | |
| 6 | +if (!Array.prototype.findLastIndex) { | |
| 7 | + Array.prototype.findLastIndex = function (callback, thisArg) { | |
| 8 | + for (let i = this.length - 1; i >= 0; i--) { | |
| 9 | + if (callback.call(thisArg, this[i], i, this)) return i; | |
| 10 | + } | |
| 11 | + return -1; | |
| 12 | + }; | |
| 13 | +} | |