aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4vme_moth.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-12-10 18:07:26 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-12-18 14:23:29 +0100
commitd2e331dfa02475e773e51af6e7532951f4d1a233 (patch)
treed16f2ef9cfd363ff09d06fed70b226ccb212f3ca /src/qml/jsruntime/qv4vme_moth.cpp
parent31211f1415f221ed1a974663fdde117fd6de357d (diff)
Allow JavaScript primitive type transformations inline in C++
We don't want to call into the engine just for adding two numbers. This implements the most common operators on primitive JavaScript values. More are to follow in the future. Change-Id: Id51a5af59a3af9fec78a2d8f293e59e6567e9204 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4vme_moth.cpp')
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index 4815f5ad91..9fefa2a38c 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -425,7 +425,7 @@ static bool compareEqualInt(QV4::Value &accumulator, QV4::Value lhs, int rhs)
d = val.toNumberImpl(); \
CHECK_EXCEPTION; \
} \
- i = Double::toInt32(d); \
+ i = QJSNumberCoercion::toInteger(d); \
} \
} while (false)