Index: test/cctest/interpreter/test-interpreter-intrinsics.cc |
diff --git a/test/cctest/interpreter/test-interpreter-intrinsics.cc b/test/cctest/interpreter/test-interpreter-intrinsics.cc |
index 70051253cca22fc04d4752559da6bfe25bae8ae3..3cb2beffd456e1624633018f04881291651bf2a9 100644 |
--- a/test/cctest/interpreter/test-interpreter-intrinsics.cc |
+++ b/test/cctest/interpreter/test-interpreter-intrinsics.cc |
@@ -112,6 +112,27 @@ |
CHECK_EQ(*factory->false_value(), *helper.Invoke(helper.NewObject("42"))); |
CHECK_EQ(*factory->true_value(), |
*helper.Invoke(helper.NewObject("new Proxy({},{})"))); |
+} |
+ |
+TEST(IsRegExp) { |
+ HandleAndZoneScope handles; |
+ |
+ InvokeIntrinsicHelper helper(handles.main_isolate(), handles.main_zone(), |
+ Runtime::kInlineIsRegExp); |
+ Factory* factory = handles.main_isolate()->factory(); |
+ |
+ CHECK_EQ(*factory->false_value(), |
+ *helper.Invoke(helper.NewObject("new Date()"))); |
+ CHECK_EQ(*factory->false_value(), |
+ *helper.Invoke(helper.NewObject("(function() {})"))); |
+ CHECK_EQ(*factory->false_value(), *helper.Invoke(helper.NewObject("([1])"))); |
+ CHECK_EQ(*factory->false_value(), *helper.Invoke(helper.NewObject("({})"))); |
+ CHECK_EQ(*factory->true_value(), *helper.Invoke(helper.NewObject("(/x/)"))); |
+ CHECK_EQ(*factory->false_value(), *helper.Invoke(helper.Undefined())); |
+ CHECK_EQ(*factory->false_value(), *helper.Invoke(helper.Null())); |
+ CHECK_EQ(*factory->false_value(), |
+ *helper.Invoke(helper.NewObject("'string'"))); |
+ CHECK_EQ(*factory->false_value(), *helper.Invoke(helper.NewObject("42"))); |
} |
TEST(IsTypedArray) { |