I have a better polyfill now, it won't delete & restore the prototype @ljharb
Still, DONT USE IT IN YOUR PRODUCT
Array.prototype.then = async function (resolve, reject) {
class NonThenableArray extends Array {}
NonThenableArray.prototype.then = 0
NonThenableArray.prototype[Symbol.species] = NonThenableArray
const result = new NonThenableArray()
// This won't make promises parallel
for (const p of this) {
try { result.push(await p) }
catch (e) { return reject(e) }
}
resolve(result)
}