OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #include "src/factory.h" |
| 6 #include "src/handles-inl.h" |
| 7 #include "src/handles.h" |
| 8 #include "src/isolate.h" |
| 9 #include "src/objects.h" |
5 #include "src/v8.h" | 10 #include "src/v8.h" |
6 | |
7 #include "test/cctest/cctest.h" | 11 #include "test/cctest/cctest.h" |
8 | 12 |
9 using namespace v8::internal; | 13 using namespace v8::internal; |
10 | 14 |
11 static void CheckObject(Isolate* isolate, Handle<Object> obj, | 15 static void CheckObject(Isolate* isolate, Handle<Object> obj, |
12 const char* string) { | 16 const char* string) { |
13 Object* print_string = *Object::NoSideEffectsToString(isolate, obj); | 17 Object* print_string = *Object::NoSideEffectsToString(isolate, obj); |
14 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); | 18 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); |
15 } | 19 } |
16 | 20 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 CheckObject(isolate, factory->NewError(isolate->error_function(), | 66 CheckObject(isolate, factory->NewError(isolate->error_function(), |
63 factory->empty_string()), | 67 factory->empty_string()), |
64 "Error"); | 68 "Error"); |
65 CheckObject(isolate, factory->NewError( | 69 CheckObject(isolate, factory->NewError( |
66 isolate->error_function(), | 70 isolate->error_function(), |
67 factory->NewStringFromAsciiChecked("fisk hest")), | 71 factory->NewStringFromAsciiChecked("fisk hest")), |
68 "Error: fisk hest"); | 72 "Error: fisk hest"); |
69 CheckObject(isolate, factory->NewJSObject(isolate->object_function()), | 73 CheckObject(isolate, factory->NewJSObject(isolate->object_function()), |
70 "#<Object>"); | 74 "#<Object>"); |
71 } | 75 } |
OLD | NEW |