From 7cbf4b90e872776adcd05ac9150b6f745606aaae Mon Sep 17 00:00:00 2001 From: davidot Date: Tue, 18 Jan 2022 19:39:36 +0100 Subject: LibJS: Implement ImportCall and HostImportModuleDynamically This allows us to load modules from scripts. This can be dangerous as it can load arbitrary files. Because of that it fails and throws by default. Currently, only js and JavaScriptTestRunner enable the default hook. This also adds tests to test-js which test module code. Because we form a spec perspective can't "enter" a module this is the easiest way to run tests without having to modify test-js to have special cases for modules. To specify modules in test-js we use the extension '.mjs' this is to ensure the files are not executed. We do still want to lint these files so the prettier scripts have changed to look for '.mjs' files as well. --- Userland/Libraries/LibJS/Tests/modules/loop-a.mjs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Userland/Libraries/LibJS/Tests/modules/loop-a.mjs (limited to 'Userland/Libraries/LibJS/Tests/modules/loop-a.mjs') diff --git a/Userland/Libraries/LibJS/Tests/modules/loop-a.mjs b/Userland/Libraries/LibJS/Tests/modules/loop-a.mjs new file mode 100644 index 0000000000..fc994711f7 --- /dev/null +++ b/Userland/Libraries/LibJS/Tests/modules/loop-a.mjs @@ -0,0 +1,3 @@ +export { bValue } from "./loop-b.mjs"; + +export const aValue = 1; -- cgit v1.2.3