You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The slicing method in the buffer.Blob is wrong according to the spec #37335
Platform: Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:11 PDT 2020; root:xnu-7195.50.7~2/RELEASE_X86_64 x86_64
Subsystem:
Thought I would try it out and help you find some quirks before making it stable. The slicing method is wrong
What steps will reproduce the bug?
import{Blob}from'buffer'newBlob().slice(0,500)newBlob(['abc']).slice(-1).text()// cnewBlob(['abc']).slice(0,-1).text()// abnewBlob(['abcdef']).slice(-3,-1).text()// de
How often does it reproduce?
Happens everytime
What is the expected behavior?
...to get a new Blob slice without throwing any error.
the slicing method should behave similar like you slice a String or a ArrayBuffer
But internally it can be more complicated then that if it should operate on multiple blob parts that are async (see #37338)
What do you see instead?
Uncaught:
RangeError [ERR_OUT_OF_RANGE]: The value of "end" is out of range.
It must be less than or equal to length. Received 500
Activity
buffer: make Blob's slice method more spec-compliant
buffer: make Blob's slice method more spec-compliant
buffer: make Blob's slice method more spec-compliant