Revision: 2522
Author: [email protected]
Date: Wed Jul 22 05:33:16 2009
Log: 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
http://code.google.com/p/v8/source/detail?r=2522

Modified:
  /branches/bleeding_edge/src/parser.cc

=======================================
--- /branches/bleeding_edge/src/parser.cc       Thu Jul 16 22:37:09 2009
+++ /branches/bleeding_edge/src/parser.cc       Wed Jul 22 05:33:16 2009
@@ -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
-~----------~----~----~----~------~----~------~--~---

Reply via email to