fix where on v8 SERVER-864

This commit is contained in:
Eliot Horowitz
2010-04-08 15:26:12 -04:00
parent 0efadc48e9
commit 48d2acc0de
4 changed files with 16 additions and 10 deletions

View File

@@ -382,14 +382,8 @@ namespace mongo {
}
bool isSimpleStatement( const string& code ){
{
size_t x = code.find( "return" );
if ( x != string::npos ){
if ( ( x == 0 || ! isalpha( code[x-1] ) ) &&
! isalpha( code[x+6] ) )
return false;
}
}
if ( hasJSReturn( code ) )
return false;
if ( code.find( ";" ) != string::npos &&
code.find( ";" ) != code.rfind( ";" ) )