mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
AK: Remove the fallible constructor from FixedMemoryStream
This commit is contained in:
parent
8b2f23d016
commit
220fbcaa7e
Notes:
sideshowbarker
2024-07-17 08:55:54 +09:00
Author: https://github.com/timschumi
Commit: 220fbcaa7e
Pull-request: https://github.com/SerenityOS/serenity/pull/17264
31 changed files with 185 additions and 209 deletions
|
@ -106,8 +106,8 @@ TESTJS_GLOBAL_FUNCTION(parse_webassembly_module, parseWebAssemblyModule)
|
|||
if (!is<JS::Uint8Array>(object))
|
||||
return vm.throw_completion<JS::TypeError>("Expected a Uint8Array argument to parse_webassembly_module");
|
||||
auto& array = static_cast<JS::Uint8Array&>(*object);
|
||||
auto stream = FixedMemoryStream::construct(array.data()).release_value_but_fixme_should_propagate_errors();
|
||||
auto result = Wasm::Module::parse(*stream);
|
||||
FixedMemoryStream stream { array.data() };
|
||||
auto result = Wasm::Module::parse(stream);
|
||||
if (result.is_error())
|
||||
return vm.throw_completion<JS::SyntaxError>(Wasm::parse_error_to_deprecated_string(result.error()));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue