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 "platform/assert.h" | 5 #include "platform/assert.h" |
6 #include "vm/assembler.h" | 6 #include "vm/assembler.h" |
7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 Class& interface = Class::Handle(); | 103 Class& interface = Class::Handle(); |
104 String& interface_name = String::Handle(); | 104 String& interface_name = String::Handle(); |
105 interface_name = Symbols::New("Harley"); | 105 interface_name = Symbols::New("Harley"); |
106 interface = Class::New(interface_name, script, Scanner::kDummyTokenIndex); | 106 interface = Class::New(interface_name, script, Scanner::kDummyTokenIndex); |
107 interfaces.SetAt(0, Type::Handle(Type::NewNonParameterizedType(interface))); | 107 interfaces.SetAt(0, Type::Handle(Type::NewNonParameterizedType(interface))); |
108 interface_name = Symbols::New("Norton"); | 108 interface_name = Symbols::New("Norton"); |
109 interface = Class::New(interface_name, script, Scanner::kDummyTokenIndex); | 109 interface = Class::New(interface_name, script, Scanner::kDummyTokenIndex); |
110 interfaces.SetAt(1, Type::Handle(Type::NewNonParameterizedType(interface))); | 110 interfaces.SetAt(1, Type::Handle(Type::NewNonParameterizedType(interface))); |
111 cls.set_interfaces(interfaces); | 111 cls.set_interfaces(interfaces); |
112 cls.Finalize(); | 112 cls.Finalize(); |
113 | |
114 ASSERT(cls.functions_cache() == Array::null()); | |
115 cls.InitFunctionsCache(); | |
116 const Array& array = Array::Handle(cls.functions_cache()); | |
117 array.SetAt(0, function_name); | |
118 cls.set_functions_cache(array); | |
119 String& test_name = String::Handle(); | |
120 test_name ^= Array::Handle(cls.functions_cache()).At(0); | |
121 EXPECT(test_name.Equals(function_name)); | |
122 } | 113 } |
123 | 114 |
124 | 115 |
125 TEST_CASE(TypeArguments) { | 116 TEST_CASE(TypeArguments) { |
126 const Type& type1 = Type::Handle(Type::DoubleInterface()); | 117 const Type& type1 = Type::Handle(Type::DoubleInterface()); |
127 const Type& type2 = Type::Handle(Type::StringInterface()); | 118 const Type& type2 = Type::Handle(Type::StringInterface()); |
128 const TypeArguments& type_arguments1 = TypeArguments::Handle( | 119 const TypeArguments& type_arguments1 = TypeArguments::Handle( |
129 TypeArguments::New(2)); | 120 TypeArguments::New(2)); |
130 type_arguments1.SetTypeAt(0, type1); | 121 type_arguments1.SetTypeAt(0, type1); |
131 type_arguments1.SetTypeAt(1, type2); | 122 type_arguments1.SetTypeAt(1, type2); |
(...skipping 2735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2867 "#6 MyClass.foo (dart:test-lib:32:14)\n" | 2858 "#6 MyClass.foo (dart:test-lib:32:14)\n" |
2868 "#7 MyClass.MyClass.<anonymous closure> (dart:test-lib:21:15)\n" | 2859 "#7 MyClass.MyClass.<anonymous closure> (dart:test-lib:21:15)\n" |
2869 "#8 MyClass.MyClass (dart:test-lib:21:18)\n" | 2860 "#8 MyClass.MyClass (dart:test-lib:21:18)\n" |
2870 "#9 main.<anonymous closure> (dart:test-lib:37:10)\n" | 2861 "#9 main.<anonymous closure> (dart:test-lib:37:10)\n" |
2871 "#10 main (dart:test-lib:37:24)"); | 2862 "#10 main (dart:test-lib:37:24)"); |
2872 } | 2863 } |
2873 | 2864 |
2874 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 2865 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
2875 | 2866 |
2876 } // namespace dart | 2867 } // namespace dart |
OLD | NEW |