diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-11-29 01:50:57 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-11-29 01:50:57 -0500 |
commit | 4e51d779c611fb9bef4671a01c917cd9c8bf197a (patch) | |
tree | 1552496f0fd0604b44f75dfcadfa6c52dfd2c1d6 /scripting/engine.cpp | |
parent | 4da350d1f6704d15e2e3596ee706af85e1990efb (diff) | |
download | mongo-4e51d779c611fb9bef4671a01c917cd9c8bf197a.tar.gz |
fix comment parsing in v8
Diffstat (limited to 'scripting/engine.cpp')
-rw-r--r-- | scripting/engine.cpp | 15 |
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; + } } |