diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-16 20:30:04 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 13:14:33 +0200 |
commit | 2f4522d72e1615404abd73c7c47db074dd4fd725 (patch) | |
tree | 7ff9057376ca80df9a2b34a52b25e2e121aea2d5 /src/qml/jsruntime/qv4globalobject.cpp | |
parent | 67b2face7ca846c84f21cbfffabb12cc22442a4e (diff) |
Fix regression with isNaN and isInf
We use std::isnan and std::isinf to determine whether a number is
NaN or Inf. Unfortunately some versions of these methods seem to
return int instead of bool, breaking the Encode() call.
Change-Id: Iec58eb3a5f344373a389ddbc7f6ee81cdead2726
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4globalobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4globalobject.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp index 46a07c07c3..e0cbee11ca 100644 --- a/src/qml/jsruntime/qv4globalobject.cpp +++ b/src/qml/jsruntime/qv4globalobject.cpp @@ -577,7 +577,7 @@ ReturnedValue GlobalFunctions::method_isNaN(SimpleCallContext *context) return Encode(false); double d = v.toNumber(); - return Encode(std::isnan(d)); + return Encode((bool)std::isnan(d)); } /// isFinite [15.1.2.5] @@ -588,7 +588,7 @@ ReturnedValue GlobalFunctions::method_isFinite(SimpleCallContext *context) return Encode(true); double d = v.toNumber(); - return Encode(std::isfinite(d)); + return Encode((bool)std::isfinite(d)); } /// decodeURI [15.1.3.1] |