diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-17 16:53:05 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-21 06:33:27 +0000 |
commit | 4b73fc5bd2fd3df10f1e7499c82da08fbd417055 (patch) | |
tree | 2eb2bbe263a9e4639c18f359a8fd1a20b4e6f28b /tests/auto/qml/qquickworkerscript/data | |
parent | 1d769f0c5f76ad06466f873b0421e59e984a263b (diff) |
Add support for ECMASCript modules in WorkerScript elements
Similar to script imports from .qml files, the .mjs extension is used to
distinguish between ES modules and plain script files.
Change-Id: Id5f9b59fb77e99e3c9d6a404e6d091d96b501ad6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/qml/qquickworkerscript/data')
-rw-r--r-- | tests/auto/qml/qquickworkerscript/data/messagehandler.mjs | 4 | ||||
-rw-r--r-- | tests/auto/qml/qquickworkerscript/data/script_module.mjs | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/qml/qquickworkerscript/data/messagehandler.mjs b/tests/auto/qml/qquickworkerscript/data/messagehandler.mjs new file mode 100644 index 0000000000..749ff561da --- /dev/null +++ b/tests/auto/qml/qquickworkerscript/data/messagehandler.mjs @@ -0,0 +1,4 @@ + +export function messageHandler(msg) { + WorkerScript.sendMessage("Hello from the module") +} diff --git a/tests/auto/qml/qquickworkerscript/data/script_module.mjs b/tests/auto/qml/qquickworkerscript/data/script_module.mjs new file mode 100644 index 0000000000..eaa191c5a7 --- /dev/null +++ b/tests/auto/qml/qquickworkerscript/data/script_module.mjs @@ -0,0 +1,5 @@ + +import { messageHandler as handler } from "./messagehandler.mjs"; + +WorkerScript.onMessage = handler + |