Index: test/cctest/compiler/test-run-intrinsics.cc |
diff --git a/test/cctest/compiler/test-run-intrinsics.cc b/test/cctest/compiler/test-run-intrinsics.cc |
index b039b3bcd4b44a7b89668d9a72b7c4fc73375ddc..d53d8644f17dde645d7be8c595e5373d79b3c6ea 100644 |
--- a/test/cctest/compiler/test-run-intrinsics.cc |
+++ b/test/cctest/compiler/test-run-intrinsics.cc |
@@ -74,6 +74,7 @@ TEST(IncrementStatsCounter) { |
TEST(IsArray) { |
FunctionTester T("(function(a) { return %_IsArray(a); })", flags); |
+ T.CheckFalse(T.NewObject("new Date()")); |
T.CheckFalse(T.NewObject("(function() {})")); |
T.CheckTrue(T.NewObject("([1])")); |
T.CheckFalse(T.NewObject("({})")); |
@@ -85,9 +86,25 @@ TEST(IsArray) { |
} |
+TEST(IsDate) { |
+ FunctionTester T("(function(a) { return %_IsDate(a); })", flags); |
+ |
+ T.CheckTrue(T.NewObject("new Date()")); |
+ T.CheckFalse(T.NewObject("(function() {})")); |
+ T.CheckFalse(T.NewObject("([1])")); |
+ T.CheckFalse(T.NewObject("({})")); |
+ T.CheckFalse(T.NewObject("(/x/)")); |
+ T.CheckFalse(T.undefined()); |
+ T.CheckFalse(T.null()); |
+ T.CheckFalse(T.Val("x")); |
+ T.CheckFalse(T.Val(1)); |
+} |
+ |
+ |
TEST(IsFunction) { |
FunctionTester T("(function(a) { return %_IsFunction(a); })", flags); |
+ T.CheckFalse(T.NewObject("new Date()")); |
T.CheckTrue(T.NewObject("(function() {})")); |
T.CheckFalse(T.NewObject("([1])")); |
T.CheckFalse(T.NewObject("({})")); |
@@ -140,6 +157,7 @@ TEST(IsObject) { |
TEST(IsRegExp) { |
FunctionTester T("(function(a) { return %_IsRegExp(a); })", flags); |
+ T.CheckFalse(T.NewObject("new Date()")); |
T.CheckFalse(T.NewObject("(function() {})")); |
T.CheckFalse(T.NewObject("([1])")); |
T.CheckFalse(T.NewObject("({})")); |