Call node:http request callback through AsyncContextFrame (#18711)

This commit is contained in:
Kai Tamkun
2025-04-01 19:27:45 -07:00
committed by GitHub
parent 38a776a404
commit 5392cd1d28
4 changed files with 44 additions and 2 deletions

View File

@@ -961,7 +961,6 @@ static EncodedJSValue NodeHTTPServer__onRequest(
bool hasBody = false;
WebCore::JSNodeHTTPResponse* nodeHTTPResponseObject = jsCast<WebCore::JSNodeHTTPResponse*>(JSValue::decode(NodeHTTPResponse__createForJS(any_server, globalObject, &hasBody, request, isSSL, response, upgrade_ctx, nodeHttpResponsePtr)));
JSC::CallData callData = getCallData(callbackObject);
args.append(nodeHTTPResponseObject);
args.append(jsBoolean(hasBody));
@@ -994,7 +993,7 @@ static EncodedJSValue NodeHTTPServer__onRequest(
}
WTF::NakedPtr<JSC::Exception> exception;
JSValue returnValue = JSC::profiledCall(globalObject, JSC::ProfilingReason::API, callbackObject, callData, jsUndefined(), args, exception);
JSValue returnValue = AsyncContextFrame::call(globalObject, callbackObject, jsUndefined(), args, exception);
if (exception) {
auto* ptr = exception.get();
exception.clear();