From 8900b7abeb5a091e80a531c0221c55faa2891e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=93=AD=E4=BD=A0=E5=87=A0=E5=93=87?= Date: Mon, 20 May 2024 16:55:17 +0800 Subject: [PATCH] fix(#163): IE8 runtime error cause catch is JS keyword --- dist/polyfill.js | 2 +- src/any.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/polyfill.js b/dist/polyfill.js index f399994..4a5c184 100644 --- a/dist/polyfill.js +++ b/dist/polyfill.js @@ -98,7 +98,7 @@ function any(arr) { try { P.resolve(args[i]) .then(resolve) - .catch(function(error) { + ['catch'](function(error) { rejectionReasons.push(error); if (rejectionReasons.length === args.length) { reject( diff --git a/src/any.js b/src/any.js index 690d16c..2357636 100644 --- a/src/any.js +++ b/src/any.js @@ -20,9 +20,9 @@ function any(arr) { var rejectionReasons = []; for (var i = 0; i < args.length; i++) { try { + // prettier-ignore P.resolve(args[i]) - .then(resolve) - .catch(function(error) { + .then(resolve)['catch'](function(error) { rejectionReasons.push(error); if (rejectionReasons.length === args.length) { reject(