summaryrefslogtreecommitdiff
path: root/src/qml/jsruntime/qv4mathobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4mathobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4mathobject.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4mathobject.cpp b/src/qml/jsruntime/qv4mathobject.cpp
index 2d9d81c64b..98a5e5f1f7 100644
--- a/src/qml/jsruntime/qv4mathobject.cpp
+++ b/src/qml/jsruntime/qv4mathobject.cpp
@@ -185,7 +185,9 @@ void MathObject::method_exp(const BuiltinFunction *, Scope &scope, CallData *cal
void MathObject::method_floor(const BuiltinFunction *, Scope &scope, CallData *callData)
{
double v = callData->argc ? callData->args[0].toNumber() : qt_qnan();
- RETURN_RESULT(Encode(std::floor(v)));
+ Value result = Primitive::fromDouble(std::floor(v));
+ result.isInt32();
+ RETURN_RESULT(result);
}
void MathObject::method_log(const BuiltinFunction *, Scope &scope, CallData *callData)