-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: 1.8.4, 2.0.4
-
Component/s: JavaScript
-
Environment:This fails on OsX and Linux.
-
Minor Change
-
ALL
Passing the string "return" to a JavaScript function apparently causes JavaScript to return abnormally. Here is the simplest example I have:
MongoDB shell version: 2.0.4
connecting to: test
> db.system.js.save({_id: "error20", value: function(a) {return a}})
> db.eval("error20(\"test\")")
test
> db.eval("error20(\"return\")")
null
Attached is a file showing the same function working for both node.js and the JavaScript interpreter in Chrome.