Index: src/runtime/runtime-regexp.cc |
diff --git a/src/runtime/runtime-regexp.cc b/src/runtime/runtime-regexp.cc |
index e96d50195a80aaa8233ed3da9b89282bfd0aa469..840264fc517f69967fea4e1b6c70ccd02ec71041 100644 |
--- a/src/runtime/runtime-regexp.cc |
+++ b/src/runtime/runtime-regexp.cc |
@@ -1088,6 +1088,14 @@ RUNTIME_FUNCTION(RuntimeReference_RegExpExec) { |
} |
+RUNTIME_FUNCTION(RuntimeReference_IsRegExp) { |
+ SealHandleScope shs(isolate); |
+ DCHECK(args.length() == 1); |
+ CONVERT_ARG_CHECKED(Object, obj, 0); |
+ return isolate->heap()->ToBoolean(obj->IsJSRegExp()); |
+} |
+ |
+ |
// Perform string match of pattern on subject, starting at start index. |
// Caller must ensure that 0 <= start_index <= sub->length(), |
// and should check that pat->length() + start_index <= sub->length(). |