Details
-
Bug
-
Resolution: Done
-
Major - P3
-
1.8.4, 2.0.4
-
This fails on OsX and Linux.
-
Minor Change
-
ALL
Description
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.