LibJS: Sync additional Import Attributes spec changes

Some steps were not updated with tc39/ecma262#3057. This patch
syncs the remaining changes.
This commit is contained in:
Feng Yu 2025-09-22 16:46:22 -07:00 committed by Jelle Raaijmakers
parent f8c4043460
commit 61c36e2865
Notes: github-actions[bot] 2025-10-22 08:59:25 +00:00
9 changed files with 120 additions and 66 deletions

View file

@ -196,6 +196,18 @@ int main(int argc, char** argv)
if (!g_vm) {
g_vm = JS::VM::create();
g_vm->set_dynamic_imports_allowed(true);
// Configure the test VM to support additional import attributes
// This allows tests to use import attributes beyond just "type"
Test::JS::g_vm->host_get_supported_import_attributes = []() -> Vector<Utf16String> {
return {
"type"_utf16,
"key"_utf16, // Used in modules/import-with-attributes.mjs test
"key1"_utf16, // Used in modules/basic-modules.js
"key2"_utf16, // Used in modules/import-with-attributes.mjs test
"default"_utf16, // Used in modules/import-with-attributes.mjs test
};
};
}
Test::JS::TestRunner test_runner(test_root, common_path, print_times, print_progress, print_json, per_file);