diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-12-10 18:07:26 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-12-18 14:23:29 +0100 |
commit | d2e331dfa02475e773e51af6e7532951f4d1a233 (patch) | |
tree | d16f2ef9cfd363ff09d06fed70b226ccb212f3ca /src/qml/jsruntime/qv4typedarray.cpp | |
parent | 31211f1415f221ed1a974663fdde117fd6de357d (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/qv4typedarray.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4typedarray.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4typedarray.cpp b/src/qml/jsruntime/qv4typedarray.cpp index f425c6c87f..c816465d76 100644 --- a/src/qml/jsruntime/qv4typedarray.cpp +++ b/src/qml/jsruntime/qv4typedarray.cpp @@ -63,7 +63,7 @@ static inline int toInt32(Value v) Q_ASSERT(v.isNumber()); if (v.isInteger()) return v.integerValue(); - return Double::toInt32(v.doubleValue()); + return QJSNumberCoercion::toInteger(v.doubleValue()); } static inline double toDouble(Value v) |