(arrayLike)
| 5 | // to avoid needing to use a full 3p implementation |
| 6 | if (!Array.from) { |
| 7 | function simpleArrayFrom(arrayLike) { |
| 8 | if (!arrayLike) { |
| 9 | return []; |
| 10 | } |
| 11 | |
| 12 | if (!arrayLike.length) { |
| 13 | return []; |
| 14 | } |
| 15 | |
| 16 | const result = []; |
| 17 | for (let i = 0; i < arrayLike.length; i++) { |
| 18 | result[i] = arrayLike[i]; |
| 19 | } |
| 20 | return result; |
| 21 | } |
| 22 | |
| 23 | Object.defineProperty(Array, 'from', { |
| 24 | writable: true, |
nothing calls this directly
no outgoing calls
no test coverage detected