| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/assembler.h" | 5 #include "vm/assembler.h" |
| 6 #include "vm/bigint_operations.h" | 6 #include "vm/bigint_operations.h" |
| 7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
| 8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
| (...skipping 4059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4070 } | 4070 } |
| 4071 Object& handle = Object::Handle(obj); | 4071 Object& handle = Object::Handle(obj); |
| 4072 // Skip some common simple objects to run in reasonable time. | 4072 // Skip some common simple objects to run in reasonable time. |
| 4073 if (handle.IsString() || | 4073 if (handle.IsString() || |
| 4074 handle.IsArray() || | 4074 handle.IsArray() || |
| 4075 handle.IsLiteralToken()) { | 4075 handle.IsLiteralToken()) { |
| 4076 return; | 4076 return; |
| 4077 } | 4077 } |
| 4078 JSONStream js; | 4078 JSONStream js; |
| 4079 handle.PrintToJSONStream(&js, false); | 4079 handle.PrintToJSONStream(&js, false); |
| 4080 // TODO(koda): When all objects include a "type" field, expect that here. | 4080 EXPECT_SUBSTRING("\"type\":", js.ToCString()); |
| 4081 } | 4081 } |
| 4082 }; | 4082 }; |
| 4083 | 4083 |
| 4084 | 4084 |
| 4085 TEST_CASE(PrintToJSONStream) { | 4085 TEST_CASE(PrintToJSONStream) { |
| 4086 Heap* heap = Isolate::Current()->heap(); | 4086 Heap* heap = Isolate::Current()->heap(); |
| 4087 heap->CollectAllGarbage(); | 4087 heap->CollectAllGarbage(); |
| 4088 JSONTypeVerifier verifier; | 4088 JSONTypeVerifier verifier; |
| 4089 heap->IterateObjects(&verifier); | 4089 heap->IterateObjects(&verifier); |
| 4090 } | 4090 } |
| 4091 | 4091 |
| 4092 } // namespace dart | 4092 } // namespace dart |
| OLD | NEW |