Skip to content

Commit bb999bb

Browse files
author
Ben Becker
committed
SERVER-9124: cast id to double before converting to JS
1 parent b7b6c38 commit bb999bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripting/engine_spidermonkey.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,14 +1581,14 @@ namespace mongo {
15811581
string name = field;
15821582
long long funcId = static_cast<long long>(_functionMap.size());
15831583
_functionMap.insert(make_pair(funcId, func));
1584-
jsval v = _convertor->toval(funcId);
1584+
jsval v = _convertor->toval((static_cast<double>(funcId)));
15851585
_convertor->setProperty(_global, (name + "_").c_str(), v);
1586-
15871586
stringstream code;
1587+
15881588
if (data) {
15891589
long long argsId = static_cast<long long>(_argumentMap.size());
15901590
_argumentMap.insert(make_pair(argsId, data));
1591-
v = _convertor->toval(argsId);
1591+
v = _convertor->toval(static_cast<double>(argsId));
15921592
_convertor->setProperty(_global, (name + "_data_").c_str(), v);
15931593
code << field << "_" << " = { x : " << field << "_ , y: " << field << "_data_ }; ";
15941594
} else {

0 commit comments

Comments
 (0)