diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-09-06 23:08:37 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-06 23:08:37 +0530 |
commit | d2a408f452db1157a1e6a14810bd1f03fc431d9d (patch) | |
tree | 66c45829a78cb3c6cd6e875cca65ce26384fe50d /core/01_core.js | |
parent | c0a684c14ed70717e18b528bb8f366eb593636a7 (diff) |
perf(runtime): short-circuit `queue_async_op` for Poll::Ready (#15773)
Diffstat (limited to 'core/01_core.js')
-rw-r--r-- | core/01_core.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/01_core.js b/core/01_core.js index ab9722bc1..fda3e4977 100644 --- a/core/01_core.js +++ b/core/01_core.js @@ -160,10 +160,11 @@ function opAsync(opName, ...args) { const promiseId = nextPromiseId++; + let p = setPromise(promiseId); const maybeError = ops[opName](promiseId, ...args); // Handle sync error (e.g: error parsing args) if (maybeError) return unwrapOpResult(maybeError); - let p = PromisePrototypeThen(setPromise(promiseId), unwrapOpResult); + p = PromisePrototypeThen(p, unwrapOpResult); if (opCallTracingEnabled) { // Capture a stack trace by creating a new `Error` object. We remove the // first 6 characters (the `Error\n` prefix) to get just the stack trace. |