mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibJS: Propagate errors from VM creation
This commit is contained in:
parent
eb5aae24f4
commit
13dfadba79
13 changed files with 15 additions and 15 deletions
|
@ -34,16 +34,16 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
NonnullRefPtr<VM> VM::create(OwnPtr<CustomData> custom_data)
|
||||
ErrorOr<NonnullRefPtr<VM>> VM::create(OwnPtr<CustomData> custom_data)
|
||||
{
|
||||
ErrorMessages error_messages {};
|
||||
error_messages[to_underlying(ErrorMessage::OutOfMemory)] = String::from_utf8(ErrorType::OutOfMemory.message()).release_value_but_fixme_should_propagate_errors();
|
||||
error_messages[to_underlying(ErrorMessage::OutOfMemory)] = TRY(String::from_utf8(ErrorType::OutOfMemory.message()));
|
||||
|
||||
auto vm = adopt_ref(*new VM(move(custom_data), move(error_messages)));
|
||||
|
||||
WellKnownSymbols well_known_symbols {
|
||||
#define __JS_ENUMERATE(SymbolName, snake_name) \
|
||||
Symbol::create(*vm, "Symbol." #SymbolName##_string.release_value_but_fixme_should_propagate_errors(), false),
|
||||
Symbol::create(*vm, TRY("Symbol." #SymbolName##_string), false),
|
||||
JS_ENUMERATE_WELL_KNOWN_SYMBOLS
|
||||
#undef __JS_ENUMERATE
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue