Reviewers: lrn,

Description:
Fixed test failures in debug mode caused by merging in Mads' changes
that disallowed handles containing failures.

Please review this at http://codereview.chromium.org/10889

Affected files:
   M src/jsregexp.cc
   M src/runtime.cc


Index: src/jsregexp.cc
diff --git a/src/jsregexp.cc b/src/jsregexp.cc
index  
40f9fee31ab540c4ce8b68abe3a69b09547e3c62..28b8745d134d85e340e5bf2db03f4a7235000fee
  
100644
--- a/src/jsregexp.cc
+++ b/src/jsregexp.cc
@@ -184,15 +184,15 @@ static JSRegExp::Flags  
RegExpFlagsFromString(Handle<String> str) {
  }


-static inline Handle<Object> CreateRegExpException(Handle<JSRegExp> re,
-                                                   Handle<String> pattern,
-                                                   Handle<String>  
error_text,
-                                                   const char* message) {
+static inline void ThrowRegExpException(Handle<JSRegExp> re,
+                                        Handle<String> pattern,
+                                        Handle<String> error_text,
+                                        const char* message) {
    Handle<JSArray> array = Factory::NewJSArray(2);
    SetElement(array, 0, pattern);
    SetElement(array, 1, error_text);
    Handle<Object> regexp_err = Factory::NewSyntaxError(message, array);
-  return Handle<Object>(Top::Throw(*regexp_err));
+  Top::Throw(*regexp_err);
  }


@@ -212,10 +212,11 @@ Handle<Object> RegExpImpl::Compile(Handle<JSRegExp>  
re,
      RegExpParseResult parse_result;
      if (!ParseRegExp(&buffer, &parse_result)) {
        // Throw an exception if we fail to parse the pattern.
-      return CreateRegExpException(re,
-                                   pattern,
-                                   parse_result.error,
-                                   "malformed_regexp");
+      ThrowRegExpException(re,
+                           pattern,
+                           parse_result.error,
+                           "malformed_regexp");
+      return Handle<Object>();
      }
      RegExpAtom* atom = parse_result.tree->AsAtom();
      if (atom != NULL && !flags.is_ignore_case()) {
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index  
132ccb47b9f820e192ef0520850d6eedd0c776f2..335e6190a41398a9de485cc622a29305e6d244b2
  
100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -288,7 +288,7 @@ static Object* Runtime_IsConstructCall(Arguments args) {


  static Object* Runtime_RegExpCompile(Arguments args) {
-  HandleScope scope;  // create a new handle scope
+  HandleScope scope;
    ASSERT(args.length() == 3);
    CONVERT_CHECKED(JSRegExp, raw_re, args[0]);
    Handle<JSRegExp> re(raw_re);



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to