mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibJS+Everywhere: Convert JS::Error to String
This includes an Error::create overload to create an Error from a UTF-8 StringView. If creating a String from that view fails, the factory will return an OOM InternalError instead. VM::throw_completion can also make use of this overload via its perfect forwarding.
This commit is contained in:
parent
153b793638
commit
88814acbd3
Notes:
sideshowbarker
2024-07-17 02:38:39 +09:00
Author: https://github.com/trflynn89
Commit: 88814acbd3
Pull-request: https://github.com/SerenityOS/serenity/pull/17494
Reviewed-by: https://github.com/linusg ✅
36 changed files with 198 additions and 151 deletions
|
@ -44,7 +44,7 @@ JS::ThrowCompletionOr<JS::NonnullGCPtr<JS::Object>> WebAssemblyMemoryConstructor
|
|||
|
||||
auto address = WebAssemblyObject::s_abstract_machine.store().allocate(Wasm::MemoryType { Wasm::Limits { initial, maximum } });
|
||||
if (!address.has_value())
|
||||
return vm.throw_completion<JS::TypeError>("Wasm Memory allocation failed");
|
||||
return vm.throw_completion<JS::TypeError>("Wasm Memory allocation failed"sv);
|
||||
|
||||
return MUST_OR_THROW_OOM(vm.heap().allocate<WebAssemblyMemoryObject>(realm, realm, *address));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue