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

Unified Diff: src/jsregexp.cc

Issue 247013002: Replaced empty handle checks with MaybeHandles (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed unnecessary assert. Created 6 years, 8 months 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 | « src/jsregexp.h ('k') | src/objects.h » ('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 5fa6cf49d7750689ece45a1dcf67aa36604e7ac9..2ab2d273f08c2535c37c3696f4d440f6ba4038e1 100644
--- a/src/jsregexp.cc
+++ b/src/jsregexp.cc
@@ -236,23 +236,19 @@ MaybeHandle<Object> RegExpImpl::Compile(Handle<JSRegExp> re,
}
-Handle<Object> RegExpImpl::Exec(Handle<JSRegExp> regexp,
- Handle<String> subject,
- int index,
- Handle<JSArray> last_match_info) {
+MaybeHandle<Object> RegExpImpl::Exec(Handle<JSRegExp> regexp,
+ Handle<String> subject,
+ int index,
+ Handle<JSArray> last_match_info) {
switch (regexp->TypeTag()) {
case JSRegExp::ATOM:
return AtomExec(regexp, subject, index, last_match_info);
case JSRegExp::IRREGEXP: {
- Handle<Object> result =
- IrregexpExec(regexp, subject, index, last_match_info);
- ASSERT(!result.is_null() ||
- regexp->GetIsolate()->has_pending_exception());
- return result;
+ return IrregexpExec(regexp, subject, index, last_match_info);
}
default:
UNREACHABLE();
- return Handle<Object>::null();
+ return MaybeHandle<Object>();
}
}
@@ -641,10 +637,10 @@ int RegExpImpl::IrregexpExecRaw(Handle<JSRegExp> regexp,
}
-Handle<Object> RegExpImpl::IrregexpExec(Handle<JSRegExp> regexp,
- Handle<String> subject,
- int previous_index,
- Handle<JSArray> last_match_info) {
+MaybeHandle<Object> RegExpImpl::IrregexpExec(Handle<JSRegExp> regexp,
+ Handle<String> subject,
+ int previous_index,
+ Handle<JSArray> last_match_info) {
Isolate* isolate = regexp->GetIsolate();
ASSERT_EQ(regexp->TypeTag(), JSRegExp::IRREGEXP);
@@ -660,7 +656,7 @@ Handle<Object> RegExpImpl::IrregexpExec(Handle<JSRegExp> regexp,
if (required_registers < 0) {
// Compiling failed with an exception.
ASSERT(isolate->has_pending_exception());
- return Handle<Object>::null();
+ return MaybeHandle<Object>();
}
int32_t* output_registers = NULL;
@@ -682,7 +678,7 @@ Handle<Object> RegExpImpl::IrregexpExec(Handle<JSRegExp> regexp,
}
if (res == RE_EXCEPTION) {
ASSERT(isolate->has_pending_exception());
- return Handle<Object>::null();
+ return MaybeHandle<Object>();
}
ASSERT(res == RE_FAILURE);
return isolate->factory()->null_value();
« no previous file with comments | « src/jsregexp.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698