Interaction of lack of AllowShared and unions seems to not follow the spec
Categories
(Core :: DOM: Bindings (WebIDL), defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: edgar)
References
Details
Attachments
(1 file)
Consider this testcase:
var xhr = new XMLHttpRequest();
xhr.open("GET", "");
xhr.send(new Uint8Array(new SharedArrayBuffer(2)));
I was expecting this to throw, but it does not. This is because our union code treats lack of [AllowShared] as meaning "a thing backed by a shared thing is not a valid value for the type, move to the next type", and we end up at the USVString branch of the union and stringify the object. I think per spec this should throw, though it talks about [AllowShared] creating a different type, etc... but the actual specced behavior is "same type, but with an extra check".
I expect the same thing would be a problem for array buffer views that are distinguishing arguments for overloads.
If my understanding of the spec is correct, then the fix is for onFailureIsShared
to just ignore failureCode
and always throw.
![]() |
Reporter | |
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Yes, it should throw per current spec of converting a buffer source type.
Assignee | ||
Comment 2•5 years ago
|
||
Converting a shared buffer source to buffer souce type should
always throw if the type isn't annotated with [AllowShared].
Updated•5 years ago
|
Updated•5 years ago
|
Comment 7•5 years ago
|
||
bugherder |
Description
•