aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/toolsupport
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-07-10 14:52:34 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-08-09 13:18:39 +0000
commit82da798499aa8b656e771191332864a703069739 (patch)
tree35cb1d0ef8dd3d949f8b6f6324d19ec577b3f4df /tests/auto/toolsupport
parent6510046ee32ef69d7f250fd1d829063983f93fdd (diff)
Add initial basic support for ES6 modules
The entry point from the parsing perspective into modules is not QV4::Script but QV4::ExecutionEngine::compileModule. For convenience, the ESModule AST node gets a body, which is the statement list connected between the ModuleItemList items that are not import/export declarations. The QV4::Module allocates a call context where the exported variables are stored as named locals. This will also become the module namespace object. The imports in turn is an array of value pointers that point into the locals array of the context of the imported modules. The default module loading in ExecutionEngine assumes the accessibility of module urls via QFile (so local file system or resource). This is what qmljs also uses and QJSEngine as well via public API in the future. The test runner compiles the modules manually and injects them, because they need to be compiled together with the test harness code. The QML type loader will the mechanism for injection in the future for module imports from .qml files. Change-Id: I93be9cfe54c651fdbd08c5e1d22d58f47284e54f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/toolsupport')
-rw-r--r--tests/auto/toolsupport/tst_toolsupport.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/toolsupport/tst_toolsupport.cpp b/tests/auto/toolsupport/tst_toolsupport.cpp
index cf90ab0531..eec96f9174 100644
--- a/tests/auto/toolsupport/tst_toolsupport.cpp
+++ b/tests/auto/toolsupport/tst_toolsupport.cpp
@@ -101,7 +101,7 @@ void tst_toolsupport::offsets_data()
= QTest::newRow("CompiledData::CompilationUnit::data")
<< pmm_to_offsetof(&QV4::CompiledData::CompilationUnit::data);
- data << 16 << 32;
+ data << 20 << 40;
}
{