From bb999bb5032346e4391d80225b1532bc43df9446 Mon Sep 17 00:00:00 2001 From: Ben Becker Date: Tue, 26 Mar 2013 18:33:20 -0700 Subject: SERVER-9124: cast id to double before converting to JS --- scripting/engine_spidermonkey.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp index e857b90d138..e409e6f4408 100644 --- a/scripting/engine_spidermonkey.cpp +++ b/scripting/engine_spidermonkey.cpp @@ -1581,14 +1581,14 @@ namespace mongo { string name = field; long long funcId = static_cast(_functionMap.size()); _functionMap.insert(make_pair(funcId, func)); - jsval v = _convertor->toval(funcId); + jsval v = _convertor->toval((static_cast(funcId))); _convertor->setProperty(_global, (name + "_").c_str(), v); - stringstream code; + if (data) { long long argsId = static_cast(_argumentMap.size()); _argumentMap.insert(make_pair(argsId, data)); - v = _convertor->toval(argsId); + v = _convertor->toval(static_cast(argsId)); _convertor->setProperty(_global, (name + "_data_").c_str(), v); code << field << "_" << " = { x : " << field << "_ , y: " << field << "_data_ }; "; } else { -- cgit v1.2.1