Reviewers: plesner, Description: Remove a few occurrences of the CHECK_FAILED macro in the parser. There's no reason to check if we've failed when (a) we know we have and (b) we've got a perfectly good NULL just lying around anyway.
Please review this at http://codereview.chromium.org/155920 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/parser.cc Index: src/parser.cc =================================================================== --- src/parser.cc (revision 2521) +++ src/parser.cc (working copy) @@ -3931,7 +3931,7 @@ case '*': case '+': case '?': - ReportError(CStrVector("Nothing to repeat") CHECK_FAILED); + return ReportError(CStrVector("Nothing to repeat")); case '^': { Advance(); if (multiline_) { @@ -4006,7 +4006,7 @@ case '\\': switch (Next()) { case kEndMarker: - ReportError(CStrVector("\\ at end of pattern") CHECK_FAILED); + return ReportError(CStrVector("\\ at end of pattern")); case 'b': Advance(2); builder->AddAssertion( @@ -4493,7 +4493,7 @@ return CharacterRange::Singleton(0); // Return dummy value. } case kEndMarker: - ReportError(CStrVector("\\ at end of pattern") CHECK_FAILED); + return ReportError(CStrVector("\\ at end of pattern")); default: uc32 c = ParseClassCharacterEscape(CHECK_FAILED); return CharacterRange::Singleton(c); --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
