summaryrefslogtreecommitdiff
path: root/scripting/engine.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-11-29 01:50:57 -0500
committerEliot Horowitz <eliot@10gen.com>2010-11-29 01:50:57 -0500
commit4e51d779c611fb9bef4671a01c917cd9c8bf197a (patch)
tree1552496f0fd0604b44f75dfcadfa6c52dfd2c1d6 /scripting/engine.cpp
parent4da350d1f6704d15e2e3596ee706af85e1990efb (diff)
downloadmongo-4e51d779c611fb9bef4671a01c917cd9c8bf197a.tar.gz
fix comment parsing in v8
Diffstat (limited to 'scripting/engine.cpp')
-rw-r--r--scripting/engine.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripting/engine.cpp b/scripting/engine.cpp
index ae67b469029..a28cff2983b 100644
--- a/scripting/engine.cpp
+++ b/scripting/engine.cpp
@@ -457,5 +457,20 @@ namespace mongo {
( x == 0 || ! isalpha( code[x-1] ) ) &&
! isalpha( code[x+6] );
}
+
+ const char * jsSkipWhiteSpace( const char * raw ){
+ while ( raw[0] ){
+ while (isspace(*raw)) {
+ raw++;
+ }
+
+ if ( raw[0] != '/' || raw[1] != '/' )
+ break;
+
+ while ( raw[0] && raw[0] != '\n' )
+ raw++;
+ }
+ return raw;
+ }
}