mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibJS: Add a mode to parse JS as a module
In a module strict mode should be enabled at the start of parsing and we allow import and export statements.
This commit is contained in:
@@ -85,7 +85,9 @@ TESTJS_RUN_FILE_FUNCTION(const String& test_file, JS::Interpreter&)
|
||||
else
|
||||
return Test::JS::RunFileHookResult::SkipFile;
|
||||
|
||||
auto parse_result = Test::JS::parse_file(test_file);
|
||||
auto program_type = path.basename().ends_with(".module.js") ? JS::Program::Type::Module : JS::Program::Type::Script;
|
||||
|
||||
auto parse_result = Test::JS::parse_file(test_file, program_type);
|
||||
bool test_passed = true;
|
||||
String message;
|
||||
String expectation_string;
|
||||
|
||||
Reference in New Issue
Block a user