summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/util.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-08-04 11:33:49 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-08-04 19:26:14 +0000
commitdf950b87e781daf92364afb22f13d87b18858c80 (patch)
treea333e02d43ee4909c7cffcae131aac2cf5a8b45a /fpdfsdk/javascript/util.cpp
parent5c09f4ca825652f910d3ff406fcbf64d25f56e23 (diff)
downloadpdfium-df950b87e781daf92364afb22f13d87b18858c80.tar.xz
Remove platform-specific IsFinite, JS_PortIsNan, and GetNan.
Because C++11 gives us std::isfinite(), std::isnan() and std::nan(). Bug: pdfium:459 Change-Id: I128f332ec908df6aff66ef76012288fd22d423ed Reviewed-on: https://pdfium-review.googlesource.com/10190 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/util.cpp')
-rw-r--r--fpdfsdk/javascript/util.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/fpdfsdk/javascript/util.cpp b/fpdfsdk/javascript/util.cpp
index 93e178e9b7..e00f9e1560 100644
--- a/fpdfsdk/javascript/util.cpp
+++ b/fpdfsdk/javascript/util.cpp
@@ -9,6 +9,7 @@
#include <time.h>
#include <algorithm>
+#include <cmath>
#include <cwctype>
#include <string>
#include <vector>
@@ -395,7 +396,7 @@ bool util::scand(CJS_Runtime* pRuntime,
dDate = CJS_PublicMethods::MakeRegularDate(sDate, sFormat, nullptr);
}
- if (!JS_PortIsNan(dDate)) {
+ if (!std::isnan(dDate)) {
vRet = CJS_Value(pRuntime, CJS_Date(pRuntime, dDate));
} else {
vRet.SetNull(pRuntime);