/* * Copyright (c) 2020, the SerenityOS developers. * Copyright (c) 2022, Luke Wilde * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include #include extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { auto js = StringView(static_cast(data), size); auto vm = JS::VM::create(); auto interpreter = JS::Interpreter::create(*vm); auto parse_result = JS::Script::parse(js, interpreter->realm()); if (!parse_result.is_error()) (void)interpreter->run(parse_result.value()); return 0; }