mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +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:
parent
d6d7d11590
commit
7613c22b06
8 changed files with 38 additions and 15 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue