You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -34,8 +32,47 @@ const result = new Promise(function executor(resolve, reject) {
34
32
35
33
The executor function can also be an `async function`. However, this is usually a mistake, for a few reasons:
36
34
37
-
- If an async executor function throws an error, the error will be lost and won’t cause the newly-constructed `Promise` to reject.This could make it difficult to debug and handle some errors.
38
-
- If a Promise executor function is using `await`, this is usually a sign that it is not actually necessary to use the `new Promise` constructor, or the scope of the `new Promise` constructor can be reduced.
35
+
- If an async executor function throws an error, the error will be lost and won’t cause
36
+
the newly-constructed `Promise` to reject.This could make it difficult to debug and handle some errors.
37
+
- If a `Promise` executor function is using `await`, this is usually a sign that it is not
38
+
actually necessary to use the new `Promise` constructor, or the scope of the new
0 commit comments