If you assign a negative value to the bufferedAmountLowThreshold of a RTCDataChannel, it will be assigned an overflow value.
A more reasonable way of handling it is described in the design principles document;
Any nonnegative JavaScript number in the integer-representable range, throwing a TypeError outside the range and rounding inside of it
It would be more correct to say that "a more reasonable way" is described in the design principles document. It's correct as specified, which doesn't mean that it's reasonable.
I would definitely upvote changing that but we shouldn't stop there. In my opinion, every settable u8, u16, u32, u64 (oh wait, that's too much for JS to handle, I forgot) should be strict (with [EnforceRange]).
Most helpful comment
I would definitely upvote changing that but we shouldn't stop there. In my opinion, every settable u8, u16, u32, u64 (oh wait, that's too much for JS to handle, I forgot) should be strict (with
[EnforceRange]).