Skip to content

Commit

Permalink
fix comments in embedded code SERVER-2121
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed Nov 22, 2010
1 parent 6ad12a6 commit 99647eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions jstests/mr_comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -24,5 +24,5 @@ res = db.runCommand(
},
out: "mr_comments_out"
});
printjson( res );

assert.eq( 3 , res.counts.emit )
12 changes: 10 additions & 2 deletions scripting/engine_spidermonkey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 99647eb

Please sign in to comment.