WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
304996
WebTransportError constructor mishandles single options argument and treats it as message
https://bugs.webkit.org/show_bug.cgi?id=304996
Summary
WebTransportError constructor mishandles single options argument and treats i...
ankshit
Reported
2026-01-06 11:30:40 PST
When WebTransportError is constructed with a single options object argument, the object is incorrectly interpreted as the message parameter and stringified to "[object Object]", rather than being recognized as the options dictionary. ``` // Fail const e1 = new WebTransportError({ streamErrorCode: 42 }); console.log(e1.streamErrorCode); // null (expected: 42) console.log(e1.message); // "[object Object]" (expected: "") // Pass const e2 = new WebTransportError('test error', { streamErrorCode: 42 }); console.log(e2.streamErrorCode); // 42 (expected: 42) console.log(e2.message); // "test error" (expected: "test error") ``` The IDL interface correctly marks both arguments as optional: ``` interface WebTransportError : DOMException { constructor(optional DOMString message = "", optional WebTransportErrorOptions options = {}); readonly attribute WebTransportErrorSource source; readonly attribute unsigned long? streamErrorCode; }; ```
Attachments
Add attachment
proposed patch, testcase, etc.
Alex Christensen
Comment 1
2026-01-06 12:18:08 PST
This seems to be an issue with the generated JSWebTransportErrorDOMConstructor::construct. I'm not sure if we have other functions with multiple optional arguments of different types, but it should try to line up the types.
Radar WebKit Bug Importer
Comment 2
2026-01-06 17:44:02 PST
<
rdar://problem/167662230
>
Alex Christensen
Comment 3
2026-01-06 17:46:20 PST
Pull request:
https://github.com/WebKit/WebKit/pull/56176
EWS
Comment 4
2026-01-08 13:21:22 PST
Committed
305306@main
(d6cbf74934a6): <
https://commits.webkit.org/305306@main
> Reviewed commits have been landed. Closing PR #56176 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug