summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmstring.cpp
diff options
context:
space:
mode:
authorMorten Sørvig <morten.sorvig@qt.io>2021-05-21 12:03:58 +0200
committerMorten Sørvig <morten.sorvig@qt.io>2021-06-22 13:11:20 +0200
commita97445274ab94e38f457a0d874ec64aa0da60846 (patch)
tree989b2efa384c8b61d1b102168e6d21334c432c20 /src/plugins/platforms/wasm/qwasmstring.cpp
parent586027f7fd1e148ed95af8da793e42ceb405770a (diff)
wasm: use module_property instead of global(“Module”)
Depending on build options, the module can have a different name, or be a non-global object. We were already using module_property in many places, but some were missing. In the case of the clipboard code, there is actually no need to export all of the C++ functions to JavaScript and then resolve them from the module; instead call them directly. Change-Id: I83aa3ad01ad961d48e21f0994e0c205d833cbe8a Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmstring.cpp')
-rw-r--r--src/plugins/platforms/wasm/qwasmstring.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/wasm/qwasmstring.cpp b/src/plugins/platforms/wasm/qwasmstring.cpp
index b1be405eeb..1f2668af05 100644
--- a/src/plugins/platforms/wasm/qwasmstring.cpp
+++ b/src/plugins/platforms/wasm/qwasmstring.cpp
@@ -36,7 +36,7 @@ using namespace emscripten;
val QWasmString::fromQString(const QString &str)
{
static const val UTF16ToString(
- val::global("Module")["UTF16ToString"]);
+ val::module_property("UTF16ToString"));
auto ptr = quintptr(str.utf16());
return UTF16ToString(val(ptr));
@@ -49,7 +49,7 @@ QString QWasmString::toQString(const val &v)
return result;
static const val stringToUTF16(
- val::global("Module")["stringToUTF16"]);
+ val::module_property("stringToUTF16"));
static const val length("length");
int len = v[length].as<int>();