summaryrefslogtreecommitdiff
path: root/src/mongo/scripting/mozjs/numberlong.cpp
diff options
context:
space:
mode:
authorNathan Brown <nathan.brown@10gen.com>2019-06-06 10:39:58 -0400
committerNathan Brown <nathan.brown@10gen.com>2019-06-27 10:04:18 -0400
commit0fefcf84347a2bcc4961baec0295b9d04047d86f (patch)
treece86921e5b14ee83a00400f4f4e8712093505cb8 /src/mongo/scripting/mozjs/numberlong.cpp
parenta700238800aa2bf1e10c255337ec35373ffd2667 (diff)
downloadmongo-0fefcf84347a2bcc4961baec0295b9d04047d86f.tar.gz
SERVER-7143 replace standard library number parsing with custom NumberParser
Diffstat (limited to 'src/mongo/scripting/mozjs/numberlong.cpp')
-rw-r--r--src/mongo/scripting/mozjs/numberlong.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/scripting/mozjs/numberlong.cpp b/src/mongo/scripting/mozjs/numberlong.cpp
index 32163e6c31e..0fbc1aee999 100644
--- a/src/mongo/scripting/mozjs/numberlong.cpp
+++ b/src/mongo/scripting/mozjs/numberlong.cpp
@@ -173,8 +173,8 @@ void NumberLongInfo::construct(JSContext* cx, JS::CallArgs args) {
// values to fail rather than return 0 (which is the behavior of ToInt64).
std::string str = ValueWriter(cx, arg).toString();
- // Call parseNumberFromStringWithBase() function to convert string to a number
- Status status = parseNumberFromStringWithBase(str, 10, &numLong);
+ // Call NumberParser() function to convert string to a number
+ Status status = NumberParser{}.base(10)(str, &numLong);
uassert(ErrorCodes::BadValue, "could not convert string to long long", status.isOK());
} else {
numLong = ValueWriter(cx, arg).toInt64();