1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:47:45 +00:00

LibJS: Propagate errors from VM creation

This commit is contained in:
Timothy Flynn 2023-03-17 10:44:47 -04:00 committed by Linus Groh
parent eb5aae24f4
commit 13dfadba79
13 changed files with 15 additions and 15 deletions

View file

@ -15,7 +15,7 @@
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto js = StringView(static_cast<unsigned char const*>(data), size);
auto vm = JS::VM::create();
auto vm = MUST(JS::VM::create());
auto interpreter = JS::Interpreter::create<JS::GlobalObject>(*vm);
auto parse_result = JS::Script::parse(js, interpreter->realm());
if (!parse_result.is_error())

View file

@ -190,7 +190,7 @@ int main(int, char**)
reprl_input = (char*)mmap(0, REPRL_MAX_DATA_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, REPRL_DRFD, 0);
VERIFY(reprl_input != MAP_FAILED);
auto vm = JS::VM::create();
auto vm = MUST(JS::VM::create());
auto interpreter = JS::Interpreter::create<TestRunnerGlobalObject>(*vm);
while (true) {

View file

@ -359,7 +359,7 @@ extern "C" int initialize_repl(char const* time_zone)
if (time_zone)
setenv("TZ", time_zone, 1);
g_vm = JS::VM::create();
g_vm = MUST(JS::VM::create());
g_vm->enable_default_host_import_module_dynamically_hook();
// NOTE: These will print out both warnings when using something like Promise.reject().catch(...) -