From afd722efd40da88379886326ad9bcead7c5dc7f9 Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Tue, 27 Dec 2022 15:31:12 +0200 Subject: [PATCH] polish: remove misleading comment 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. --- src/execution/execute.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/execution/execute.ts b/src/execution/execute.ts index 052cb8da25..b1da51e4aa 100644 --- a/src/execution/execute.ts +++ b/src/execution/execute.ts @@ -933,8 +933,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;