Re: [whatwg/encoding] Make encodeInto() throw when given a detached buffer (Issue #324)

skyz1 left a comment (whatwg/encoding#324)

I was made aware of this issue while [fixing a crash in ladybird](https://github.com/LadybirdBrowser/ladybird/pull/4399) that was caused by passing a detached buffer to `encodeInto`. We now treat this case as a noop by reading and writing 0 bytes in order to align our implementation with the major engines.

In my opinion, throwing would have been the better solution, but this noop behavior is already widely adapted. Thus it would make sense to also explicitly include it in the spec.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/324#issuecomment-2816666810
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/encoding/issues/324/2816666810@github.com>

Received on Saturday, 19 April 2025 11:27:44 UTC