Modules: improved handling of results of async handlers.#984
Merged
VadimZhestikov merged 2 commits intoNov 6, 2025
Merged
Conversation
ac6576b to
9b23492
Compare
fc02e4d to
78e2f82
Compare
xeioex
reviewed
Nov 5, 2025
xeioex
reviewed
Nov 5, 2025
78e2f82 to
b1100e3
Compare
b1100e3 to
07c5b42
Compare
07c5b42 to
248db56
Compare
Previously, r.setReturnValue() had to be used when returning a value from async js_set handler.
async function hash(r) {
let hash = await crypto.subtle.digest('SHA-512', r.headersIn.host);
r.setReturnValue(Buffer.from(hash).toString('hex'));
}
Now r.setReturnValue() is not needed:
async function hash(r) {
let hash = await crypto.subtle.digest('SHA-512', r.headersIn.host);
return Buffer.from(hash).toString('hex');
}
Also added promise handling in global qjs code.
248db56 to
6b6934f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.