Webrtc-pc: RTCDataChannel.bufferedAmountLowThreshold not handled correctly

Created on 28 Aug 2018  路  2Comments  路  Source: w3c/webrtc-pc

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

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]).

All 2 comments

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]).

Was this page helpful?
0 / 5 - 0 ratings