mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
LibWeb: Accept explicit "type: undefined" in UnderlyingSource
This commit is contained in:
parent
5d48ade508
commit
bdfc14f24d
1 changed files with 5 additions and 5 deletions
|
@ -26,13 +26,13 @@ JS::ThrowCompletionOr<UnderlyingSource> UnderlyingSource::from_value(JS::VM& vm,
|
|||
.auto_allocate_chunk_size = {},
|
||||
};
|
||||
|
||||
if (TRY(object.has_property("type"))) {
|
||||
auto type_value = TRY(TRY(object.get("type")).to_string(vm));
|
||||
if (type_value == "bytes"sv) {
|
||||
auto type_value = TRY(object.get("type"));
|
||||
if (!type_value.is_undefined()) {
|
||||
auto type_string = TRY(type_value.to_string(vm));
|
||||
if (type_string == "bytes"sv)
|
||||
underlying_source.type = ReadableStreamType::Bytes;
|
||||
} else {
|
||||
else
|
||||
return vm.throw_completion<JS::TypeError>(DeprecatedString::formatted("Unknown stream type '{}'", type_value));
|
||||
}
|
||||
}
|
||||
|
||||
if (TRY(object.has_property("autoAllocateChunkSize")))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue