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 02424517d95799a153c9a9e5f68b42f752a618dc..b8fce7a1d400cf51f829cd67032b5b3740f4b17d 100644 |
--- a/test/cctest/interpreter/test-interpreter-intrinsics.cc |
+++ b/test/cctest/interpreter/test-interpreter-intrinsics.cc |
@@ -253,6 +253,27 @@ TEST(IntrinsicAsStubCall) { |
->SameValue(*sub_string_helper.NewObject("'bar'"))); |
} |
+TEST(ValueOf) { |
+ HandleAndZoneScope handles; |
+ Isolate* isolate = handles.main_isolate(); |
+ Factory* factory = isolate->factory(); |
+ InvokeIntrinsicHelper helper(handles.main_isolate(), handles.main_zone(), |
+ Runtime::kInlineValueOf); |
+ |
+ CHECK_EQ(Smi::FromInt(1234), *helper.Invoke(helper.NewObject("1234"))); |
+ CHECK_EQ(Smi::FromInt(5678), |
+ *helper.Invoke(helper.NewObject("new Object(5678)"))); |
+ |
+ CHECK_EQ(*factory->true_value(), *helper.Invoke(helper.NewObject("true"))); |
+ CHECK_EQ(*factory->false_value(), |
+ *helper.Invoke(helper.NewObject("new Object(false)"))); |
+ |
+ CHECK(helper.Invoke(helper.NewObject("'foobar'")) |
+ ->SameValue(*helper.NewObject("'foobar'"))); |
+ CHECK(helper.Invoke(helper.NewObject("new Object('foobar')")) |
+ ->SameValue(*helper.NewObject("'foobar'"))); |
+} |
+ |
} // namespace interpreter |
} // namespace internal |
} // namespace v8 |