| 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/cha.h" |
| 5 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 6 #include "vm/cha.h" | |
| 7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #include "vm/symbols.h" | 9 #include "vm/symbols.h" |
| 10 #include "vm/unit_test.h" | 10 #include "vm/unit_test.h" |
| 11 | 11 |
| 12 namespace dart { | 12 namespace dart { |
| 13 | 13 |
| 14 | |
| 15 TEST_CASE(ClassHierarchyAnalysis) { | 14 TEST_CASE(ClassHierarchyAnalysis) { |
| 16 const char* kScriptChars = | 15 const char* kScriptChars = |
| 17 "class A {" | 16 "class A {" |
| 18 " foo() { }" | 17 " foo() { }" |
| 19 " bar() { }" | 18 " bar() { }" |
| 20 "}\n" | 19 "}\n" |
| 21 "class B extends A {" | 20 "class B extends A {" |
| 22 "}\n" | 21 "}\n" |
| 23 "class C extends B {" | 22 "class C extends B {" |
| 24 " foo() { }" | 23 " foo() { }" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 EXPECT(!cha.IsGuardedClass(class_b.id())); | 89 EXPECT(!cha.IsGuardedClass(class_b.id())); |
| 91 EXPECT(cha.IsGuardedClass(class_c.id())); | 90 EXPECT(cha.IsGuardedClass(class_c.id())); |
| 92 EXPECT(cha.IsGuardedClass(class_d.id())); | 91 EXPECT(cha.IsGuardedClass(class_d.id())); |
| 93 | 92 |
| 94 const Class& closure_class = | 93 const Class& closure_class = |
| 95 Class::Handle(Isolate::Current()->object_store()->closure_class()); | 94 Class::Handle(Isolate::Current()->object_store()->closure_class()); |
| 96 EXPECT(!cha.HasSubclasses(closure_class.id())); | 95 EXPECT(!cha.HasSubclasses(closure_class.id())); |
| 97 } | 96 } |
| 98 | 97 |
| 99 } // namespace dart | 98 } // namespace dart |
| OLD | NEW |