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" | 5 #include "src/factory.h" |
6 #include "src/handles-inl.h" | 6 #include "src/handles-inl.h" |
7 #include "src/handles.h" | 7 #include "src/handles.h" |
8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
| 9 #include "src/objects-inl.h" |
9 #include "src/objects.h" | 10 #include "src/objects.h" |
10 #include "src/v8.h" | 11 #include "src/v8.h" |
11 #include "test/cctest/cctest.h" | 12 #include "test/cctest/cctest.h" |
12 | 13 |
13 using namespace v8::internal; | 14 using namespace v8::internal; |
14 | 15 |
15 static void CheckObject(Isolate* isolate, Handle<Object> obj, | 16 static void CheckObject(Isolate* isolate, Handle<Object> obj, |
16 const char* string) { | 17 const char* string) { |
17 Object* print_string = *Object::NoSideEffectsToString(isolate, obj); | 18 Object* print_string = *Object::NoSideEffectsToString(isolate, obj); |
18 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); | 19 CHECK(String::cast(print_string)->IsUtf8EqualTo(CStrVector(string))); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 CheckObject(isolate, factory->NewError(isolate->error_function(), | 67 CheckObject(isolate, factory->NewError(isolate->error_function(), |
67 factory->empty_string()), | 68 factory->empty_string()), |
68 "Error"); | 69 "Error"); |
69 CheckObject(isolate, factory->NewError( | 70 CheckObject(isolate, factory->NewError( |
70 isolate->error_function(), | 71 isolate->error_function(), |
71 factory->NewStringFromAsciiChecked("fisk hest")), | 72 factory->NewStringFromAsciiChecked("fisk hest")), |
72 "Error: fisk hest"); | 73 "Error: fisk hest"); |
73 CheckObject(isolate, factory->NewJSObject(isolate->object_function()), | 74 CheckObject(isolate, factory->NewJSObject(isolate->object_function()), |
74 "#<Object>"); | 75 "#<Object>"); |
75 } | 76 } |
OLD | NEW |