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.

Review URL: http://codereview.chromium.org/155920

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2522 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent dc30b11f
...@@ -3931,7 +3931,7 @@ RegExpTree* RegExpParser::ParseDisjunction() { ...@@ -3931,7 +3931,7 @@ RegExpTree* RegExpParser::ParseDisjunction() {
case '*': case '*':
case '+': case '+':
case '?': case '?':
ReportError(CStrVector("Nothing to repeat") CHECK_FAILED); return ReportError(CStrVector("Nothing to repeat"));
case '^': { case '^': {
Advance(); Advance();
if (multiline_) { if (multiline_) {
...@@ -4006,7 +4006,7 @@ RegExpTree* RegExpParser::ParseDisjunction() { ...@@ -4006,7 +4006,7 @@ RegExpTree* RegExpParser::ParseDisjunction() {
case '\\': case '\\':
switch (Next()) { switch (Next()) {
case kEndMarker: case kEndMarker:
ReportError(CStrVector("\\ at end of pattern") CHECK_FAILED); return ReportError(CStrVector("\\ at end of pattern"));
case 'b': case 'b':
Advance(2); Advance(2);
builder->AddAssertion( builder->AddAssertion(
...@@ -4493,7 +4493,7 @@ CharacterRange RegExpParser::ParseClassAtom(uc16* char_class) { ...@@ -4493,7 +4493,7 @@ CharacterRange RegExpParser::ParseClassAtom(uc16* char_class) {
return CharacterRange::Singleton(0); // Return dummy value. return CharacterRange::Singleton(0); // Return dummy value.
} }
case kEndMarker: case kEndMarker:
ReportError(CStrVector("\\ at end of pattern") CHECK_FAILED); return ReportError(CStrVector("\\ at end of pattern"));
default: default:
uc32 c = ParseClassCharacterEscape(CHECK_FAILED); uc32 c = ParseClassCharacterEscape(CHECK_FAILED);
return CharacterRange::Singleton(c); return CharacterRange::Singleton(c);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment