1
Fork 0
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:
Linus Groh 2023-04-12 23:21:17 +02:00 committed by Andreas Kling
parent 0a556ae26d
commit 742f6f7e26
3 changed files with 20 additions and 10 deletions

View file

@ -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;
}