diff options
author | Ben Becker <ben.becker@10gen.com> | 2013-03-26 18:33:20 -0700 |
---|---|---|
committer | Ben Becker <ben.becker@10gen.com> | 2013-03-26 18:33:20 -0700 |
commit | bb999bb5032346e4391d80225b1532bc43df9446 (patch) | |
tree | 1cc22df44ad6a35679dbf4be8ea9125323356431 | |
parent | b7b6c384463fbe5b1acce2df48101b72e2b9940b (diff) | |
download | mongo-bb999bb5032346e4391d80225b1532bc43df9446.tar.gz |
SERVER-9124: cast id to double before converting to JS
-rw-r--r-- | scripting/engine_spidermonkey.cpp | 6 |
1 files 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<long long>(_functionMap.size()); _functionMap.insert(make_pair(funcId, func)); - jsval v = _convertor->toval(funcId); + jsval v = _convertor->toval((static_cast<double>(funcId))); _convertor->setProperty(_global, (name + "_").c_str(), v); - stringstream code; + if (data) { long long argsId = static_cast<long long>(_argumentMap.size()); _argumentMap.insert(make_pair(argsId, data)); - v = _convertor->toval(argsId); + v = _convertor->toval(static_cast<double>(argsId)); _convertor->setProperty(_global, (name + "_data_").c_str(), v); code << field << "_" << " = { x : " << field << "_ , y: " << field << "_data_ }; "; } else { |