Permalink
Browse files

fix comments in embedded code SERVER-2121

  • Loading branch information...
1 parent 6ad12a6 commit 99647ebeb059a830da004fbba74fc3a99bc42c21 @erh erh committed Nov 22, 2010
Showing with 12 additions and 4 deletions.
  1. +2 −2 jstests/mr_comments.js
  2. +10 −2 scripting/engine_spidermonkey.cpp
View
@@ -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 )
@@ -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;

0 comments on commit 99647eb

Please sign in to comment.