diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-11-09 13:57:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-09 13:57:26 -0700 |
commit | 9010b8df53cd37f0410e08c43a194667974686a2 (patch) | |
tree | 97c13d696ba1216e74b745f5ce1b25ed34afa2cd /ext/http/00_serve.js | |
parent | c4029f6af22b373bf22383453cb4e2159f3b5b72 (diff) |
perf: remove knowledge of promise IDs from deno (#21132)
We can move all promise ID knowledge to deno_core, allowing us to better
experiment with promise implementation in deno_core.
`{un,}refOpPromise(promise)` is equivalent to
`{un,}refOp(promise[promiseIdSymbol])`
Diffstat (limited to 'ext/http/00_serve.js')
-rw-r--r-- | ext/http/00_serve.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/http/00_serve.js b/ext/http/00_serve.js index 5b931ccd1..fbd2014a7 100644 --- a/ext/http/00_serve.js +++ b/ext/http/00_serve.js @@ -44,7 +44,6 @@ const { ObjectPrototypeIsPrototypeOf, PromisePrototypeCatch, Symbol, - SymbolFor, TypeError, Uint8Array, Uint8ArrayPrototype, @@ -642,7 +641,6 @@ function serveHttpOnConnection(connection, signal, handler, onError, onListen) { function serveHttpOn(context, callback) { let ref = true; let currentPromise = null; - const promiseIdSymbol = SymbolFor("Deno.core.internalPromiseId"); const promiseErrorHandler = (error) => { // Abnormal exit @@ -666,7 +664,7 @@ function serveHttpOn(context, callback) { } currentPromise = op_http_wait(rid); if (!ref) { - core.unrefOp(currentPromise[promiseIdSymbol]); + core.unrefOpPromise(currentPromise); } req = await currentPromise; currentPromise = null; @@ -708,13 +706,13 @@ function serveHttpOn(context, callback) { ref() { ref = true; if (currentPromise) { - core.refOp(currentPromise[promiseIdSymbol]); + core.refOpPromise(currentPromise); } }, unref() { ref = false; if (currentPromise) { - core.unrefOp(currentPromise[promiseIdSymbol]); + core.unrefOpPromise(currentPromise); } }, [SymbolAsyncDispose]() { |