fix(request) handle undefined/null/empty signal on request (#5503)

* handle undefined/null/empty signal on request

* better approach
This commit is contained in:
Ciro Spaciari
2023-09-15 21:19:26 -07:00
committed by GitHub
parent b54e3f3c04
commit cb057e61ba
2 changed files with 38 additions and 2 deletions

View File

@@ -608,9 +608,8 @@ pub const Request = struct {
}
if (!fields.contains(.signal)) {
if (value.get(globalThis, "signal")) |signal_| {
if (value.getTruthy(globalThis, "signal")) |signal_| {
fields.insert(.signal);
if (AbortSignal.fromJS(signal_)) |signal| {
//Keep it alive
signal_.ensureStillAlive();