1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +00:00

LibJS: Remove GlobalObject parameter from native functions

This commit is contained in:
Linus Groh 2022-08-22 11:48:08 +01:00
parent 7b990c27a1
commit b465f46e00
77 changed files with 240 additions and 215 deletions

View file

@ -14,7 +14,7 @@ TEST_ROOT("Userland/Libraries/LibWasm/Tests");
TESTJS_GLOBAL_FUNCTION(read_binary_wasm_file, readBinaryWasmFile)
{
auto& realm = *global_object.associated_realm();
auto& realm = *vm.current_realm();
auto filename = TRY(vm.argument(0).to_string(vm));
auto file = Core::Stream::File::open(filename, Core::Stream::OpenMode::Read);
if (file.is_error())
@ -100,7 +100,7 @@ HashMap<Wasm::Linker::Name, Wasm::ExternValue> WebAssemblyModule::s_spec_test_na
TESTJS_GLOBAL_FUNCTION(parse_webassembly_module, parseWebAssemblyModule)
{
auto& realm = *global_object.associated_realm();
auto& realm = *vm.current_realm();
auto* object = TRY(vm.argument(0).to_object(vm));
if (!is<JS::Uint8Array>(object))
return vm.throw_completion<JS::TypeError>("Expected a Uint8Array argument to parse_webassembly_module");