Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1751)

Unified Diff: src/jsregexp.cc

Issue 10889: Fixed merge-related test failure (Closed)
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()) {
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698