stream: improve `ArrayBufferView` validation in `respondWithNewView()`
- This improves the web stream compatibility of the
respondWithNewView(view)
on ReadableStreamBYOBRequest. - Two WPT tests in 'readable-byte-streams/bad-buffers-and-views.any.js' will be passed with this fix.
- According to the recent specification, the second step below seems to be required for the argument validation:
- If ! IsDetachedBuffer(view.ViewedArrayBuffer) is true, throw a TypeError exception.
- In order to do the IsDetachedBuffer()
, I added a new function, ArrayBufferIsDetached()
, by referring to the napi_is_detached_arraybuffer().
Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com