1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:27:35 +00:00

AK: Move memory streams from LibCore

This commit is contained in:
Tim Schumacher 2023-01-25 20:19:05 +01:00 committed by Andrew Kaster
parent 11550f582b
commit 093cf428a3
46 changed files with 213 additions and 203 deletions

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibCore/MemoryStream.h>
#include <AK/MemoryStream.h>
#include <LibCore/Stream.h>
#include <LibTest/JavaScriptTestRunner.h>
#include <LibWasm/AbstractMachine/BytecodeInterpreter.h>
@ -106,7 +106,7 @@ 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 = Core::Stream::FixedMemoryStream::construct(array.data()).release_value_but_fixme_should_propagate_errors();
auto stream = FixedMemoryStream::construct(array.data()).release_value_but_fixme_should_propagate_errors();
auto result = Wasm::Module::parse(*stream);
if (result.is_error())
return vm.throw_completion<JS::SyntaxError>(Wasm::parse_error_to_deprecated_string(result.error()));