Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix comments in embedded code SERVER-2121

  • Loading branch information...
commit 99647ebeb059a830da004fbba74fc3a99bc42c21 1 parent 6ad12a6
@erh erh authored
Showing with 12 additions and 4 deletions.
  1. +2 −2 jstests/mr_comments.js
  2. +10 −2 scripting/engine_spidermonkey.cpp
View
4 jstests/mr_comments.js
@@ -14,7 +14,7 @@ res = db.runCommand(
},
out: "mr_comments_out"
});
-printjson( res );
+assert.eq( 3 , res.counts.emit )
res = db.runCommand(
{ mapreduce : "mr_comments",
@@ -24,5 +24,5 @@ res = db.runCommand(
},
out: "mr_comments_out"
});
-printjson( res );
+assert.eq( 3 , res.counts.emit )
View
12 scripting/engine_spidermonkey.cpp
@@ -419,9 +419,17 @@ namespace mongo {
JSFunction * _compileFunction( const char * raw , JSObject * assoc , const char *& gcName ){
if ( ! assoc )
assoc = JS_GetGlobalObject( _context );
+
+ while ( raw[0] ){
+ while (isspace(*raw)) {
+ raw++;
+ }
- while (isspace(*raw)) {
- raw++;
+ if ( raw[0] != '/' || raw[1] != '/' )
+ break;
+
+ while ( raw[0] && raw[0] != '\n' )
+ raw++;
}
//cout << "RAW\n---\n" << raw << "\n---" << endl;
Please sign in to comment.
Something went wrong with that request. Please try again.