起因
Promise.prototype.finally 在 EDGE 浏览器中报错
解决
!(function() {
Promise.prototype.finally =
Promise.prototype.finally ||
{
finally(fn) {
const onFinally = (cb) => Promise.resolve(fn()).then(cb);
return this.then(
(result) => onFinally(() => result),
(reason) =>
onFinally(() => {
throw reason;
}),
);
},
}.finally;
})();
参考
起因
Promise.prototype.finally在 EDGE 浏览器中报错解决
参考