mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09:00
test-js: Add global function to determine if using bytecode interpreter
This is intended to be used in adding test-js tests where there is different behaviour between the AST interpreter and bytecode mode. In particular, this is useful for tests which fail in AST, but pass in bytecode, as the AST interpreter is run in CI but bytecode is not.
This commit is contained in:
parent
af60c740e3
commit
cb23eaa92d
Notes:
sideshowbarker
2024-07-17 03:03:44 +09:00
Author: https://github.com/shannonbooth
Commit: cb23eaa92d
Pull-request: https://github.com/SerenityOS/serenity/pull/20139
Reviewed-by: https://github.com/linusg ✅
1 changed files with 5 additions and 0 deletions
|
@ -12,6 +12,11 @@ TEST_ROOT("Userland/Libraries/LibJS/Tests");
|
||||||
|
|
||||||
TESTJS_PROGRAM_FLAG(test262_parser_tests, "Run test262 parser tests", "test262-parser-tests", 0);
|
TESTJS_PROGRAM_FLAG(test262_parser_tests, "Run test262 parser tests", "test262-parser-tests", 0);
|
||||||
|
|
||||||
|
TESTJS_GLOBAL_FUNCTION(is_bytecode_interpreter_enabled, isBytecodeInterpreterEnabled, 0)
|
||||||
|
{
|
||||||
|
return JS::Value(JS::Bytecode::Interpreter::enabled());
|
||||||
|
}
|
||||||
|
|
||||||
TESTJS_GLOBAL_FUNCTION(is_strict_mode, isStrictMode, 0)
|
TESTJS_GLOBAL_FUNCTION(is_strict_mode, isStrictMode, 0)
|
||||||
{
|
{
|
||||||
return JS::Value(vm.in_strict_mode());
|
return JS::Value(vm.in_strict_mode());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue