// FIXME: 1. Let t be the type dictionary member. If t contains any characters outside the range U+0020 to U+007E, then set t to the empty string and return from these substeps.
// 2. Convert every character in t to ASCII lowercase.
type=options->type.to_lowercase();
}
// 4. Return a Blob object referring to bytes as its associated byte sequence, with its size set to the length of bytes, and its type set to the value of t from the substeps above.
// 1. The optional start parameter is a value for the start point of a slice() call, and must be treated as a byte-order position, with the zeroth position representing the first byte.
// User agents must process slice() with start normalized according to the following:
i64relative_start;
if(!start.has_value()){
// a. If the optional start parameter is not used as a parameter when making this call, let relativeStart be 0.
relative_start=0;
}else{
autostart_value=start.value();
// b. If start is negative, let relativeStart be max((size + start), 0).
if(start_value<0){
relative_start=max((size()+start_value),0);
}
// c. Else, let relativeStart be min(start, size).
else{
relative_start=min(start_value,size());
}
}
// 2. The optional end parameter is a value for the end point of a slice() call. User agents must process slice() with end normalized according to the following:
i64relative_end;
if(!end.has_value()){
// a. If the optional end parameter is not used as a parameter when making this call, let relativeEnd be size.
relative_end=size();
}else{
autoend_value=end.value();
// b. If end is negative, let relativeEnd be max((size + end), 0).
if(end_value<0){
relative_end=max((size()+end_value),0);
}
// c Else, let relativeEnd be min(end, size).
else{
relative_end=min(end_value,size());
}
}
// 3. The optional contentType parameter is used to set the ASCII-encoded string in lower case representing the media type of the Blob.
// User agents must process the slice() with contentType normalized according to the following:
Stringrelative_content_type;
if(!content_type.has_value()){
// a. If the contentType parameter is not provided, let relativeContentType be set to the empty string.
relative_content_type="";
}else{
// b. Else let relativeContentType be set to contentType and run the substeps below:
// FIXME: 1. If relativeContentType contains any characters outside the range of U+0020 to U+007E, then set relativeContentType to the empty string and return from these substeps.
// 2. Convert every character in relativeContentType to ASCII lowercase.