Skip to content

Commit

Permalink
polish: remove misleading comment (#3806)
Browse files Browse the repository at this point in the history
We could not demonstrate via actual benchmarking that the tick reduction
from awaiting a promise prior to returning it translates into real-world
performance gains. See #3796.

In any case, the promise must be awaited (irrespective of performance)
to allow the catch block to handle rejection errors. Simply returning
`completed` would result in test failures.
  • Loading branch information
yaacovCR authored Jan 2, 2023
1 parent 522f495 commit 7a609a2
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/execution/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -942,8 +942,6 @@ async function completePromisedValue(
asyncPayloadRecord,
);
if (isPromise(completed)) {
// see: https://github.com/tc39/proposal-faster-promise-adoption
// it is faster to await a promise prior to returning it from an async function
completed = await completed;
}
return completed;
Expand Down

0 comments on commit 7a609a2

Please sign in to comment.