mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:07:34 +00:00
LibWeb/Streams: Fix inconsistent uses of realm() and vm()
This is not documented yet, but the preferred style is getting both upfront instead of inlining various kinds of calls in places that use the realm and vm.
This commit is contained in:
parent
0a556ae26d
commit
742f6f7e26
3 changed files with 20 additions and 10 deletions
|
@ -27,7 +27,7 @@ JS::ThrowCompletionOr<UnderlyingSource> UnderlyingSource::from_value(JS::VM& vm,
|
|||
};
|
||||
|
||||
if (TRY(object.has_property("type"))) {
|
||||
auto type_value = TRY(TRY(object.get("type")).to_string(object.vm()));
|
||||
auto type_value = TRY(TRY(object.get("type")).to_string(vm));
|
||||
if (type_value == "bytes"sv) {
|
||||
underlying_source.type = ReadableStreamType::Bytes;
|
||||
} else {
|
||||
|
@ -36,7 +36,7 @@ JS::ThrowCompletionOr<UnderlyingSource> UnderlyingSource::from_value(JS::VM& vm,
|
|||
}
|
||||
|
||||
if (TRY(object.has_property("autoAllocateChunkSize")))
|
||||
underlying_source.auto_allocate_chunk_size = TRY(TRY(object.get("autoAllocateChunkSize")).to_bigint_int64(object.vm()));
|
||||
underlying_source.auto_allocate_chunk_size = TRY(TRY(object.get("autoAllocateChunkSize")).to_bigint_int64(vm));
|
||||
|
||||
return underlying_source;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue