Index: src/builtins/builtins-regexp.cc |
diff --git a/src/builtins/builtins-regexp.cc b/src/builtins/builtins-regexp.cc |
index a121a951c9da4abf6ca8d99fed8c4e6545592e99..9e9a38854a90e1606eddc034c965161c6813d29e 100644 |
--- a/src/builtins/builtins-regexp.cc |
+++ b/src/builtins/builtins-regexp.cc |
@@ -16,27 +16,6 @@ namespace internal { |
namespace { |
-// ES#sec-isregexp IsRegExp ( argument ) |
-Maybe<bool> IsRegExp(Isolate* isolate, Handle<Object> object) { |
- if (!object->IsJSReceiver()) return Just(false); |
- |
- Handle<JSReceiver> receiver = Handle<JSReceiver>::cast(object); |
- |
- if (isolate->regexp_function()->initial_map() == receiver->map()) { |
- // Fast-path for unmodified JSRegExp instances. |
- return Just(true); |
- } |
- |
- Handle<Object> match; |
- ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
- isolate, match, |
- JSObject::GetProperty(receiver, isolate->factory()->match_symbol()), |
- Nothing<bool>()); |
- |
- if (!match->IsUndefined(isolate)) return Just(match->BooleanValue()); |
- return Just(object->IsJSRegExp()); |
-} |
- |
Handle<String> PatternFlags(Isolate* isolate, Handle<JSRegExp> regexp) { |
static const int kMaxFlagsLength = 5 + 1; // 5 flags and '\0'; |
char flags_string[kMaxFlagsLength]; |
@@ -99,7 +78,7 @@ BUILTIN(RegExpConstructor) { |
bool pattern_is_regexp; |
{ |
- Maybe<bool> maybe_pattern_is_regexp = IsRegExp(isolate, pattern); |
+ Maybe<bool> maybe_pattern_is_regexp = Object::IsRegExp(isolate, pattern); |
if (maybe_pattern_is_regexp.IsNothing()) { |
DCHECK(isolate->has_pending_exception()); |
return isolate->heap()->exception(); |