Support JavaScript modules

- With modules JavaScript code can be split up into multiple files. We
	already implemented such a mechanism (`Engine.LoadLibrary`) in
	multiple parts of the engine. The advantage of using modules is
	that it's standart (JS-devs are familiar with it) and it doesn't
	has to be implemented multiple times.
	Note that `Engine.LoadLibrary` loads all files in a directory
	while the new `import` only loads one file.

- With modules seemingly global variables are local to that
	script/module. We already implemented such a mechanism
	(`ScriptInterface::LoadScript`).
This commit is contained in:
phosit
2025-01-15 20:38:37 +01:00
committed by phosit
parent 475053ea7c
commit c6d42ebbd5
13 changed files with 360 additions and 8 deletions
+3
View File
@@ -12,6 +12,9 @@ const configIgnores = {
"source/tools/profiler2/jquery*",
"source/tools/replayprofile/jquery*",
"source/tools/templatesanalyzer/tablefilter/",
// This files deliberately contain errors
"binaries/data/mods/_test.scriptinterface/module/import_inside_function.js",
],
};