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/globals.h" | 6 #include "vm/globals.h" |
7 #include "vm/ast.h" | 7 #include "vm/ast.h" |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/code_generator.h" | 10 #include "vm/code_generator.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
265 ASSERT(!core_lib.IsNull()); | 265 ASSERT(!core_lib.IsNull()); |
266 const Namespace& core_ns = Namespace::Handle( | 266 const Namespace& core_ns = Namespace::Handle( |
267 Namespace::New(core_lib, Array::Handle(), Array::Handle())); | 267 Namespace::New(core_lib, Array::Handle(), Array::Handle())); |
268 lib.AddImport(core_ns); | 268 lib.AddImport(core_ns); |
269 return lib; | 269 return lib; |
270 } | 270 } |
271 | 271 |
272 | 272 |
273 static RawClass* LookupClass(const Library& lib, const char* name) { | 273 static RawClass* LookupClass(const Library& lib, const char* name) { |
274 const String& cls_name = String::ZoneHandle(Symbols::New(name)); | 274 const String& cls_name = String::ZoneHandle(Symbols::New(name)); |
275 return lib.LookupClass(cls_name); | 275 return lib.LookupClass(cls_name, NULL); |
276 } | 276 } |
siva
2013/07/22 22:21:46
Ditto case here in the places where LookupClass is
regis
2013/07/22 23:51:27
Done.
| |
277 | 277 |
278 | 278 |
279 CODEGEN_TEST_GENERATE(StaticCallCodegen, test) { | 279 CODEGEN_TEST_GENERATE(StaticCallCodegen, test) { |
280 const char* kScriptChars = | 280 const char* kScriptChars = |
281 "class A {\n" | 281 "class A {\n" |
282 " static bar() { return 42; }\n" | 282 " static bar() { return 42; }\n" |
283 " static fly() { return 5; }\n" | 283 " static fly() { return 5; }\n" |
284 "}\n"; | 284 "}\n"; |
285 | 285 |
286 String& url = String::Handle(String::New("dart-test:CompileScript")); | 286 String& url = String::Handle(String::New("dart-test:CompileScript")); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
545 EXPECT(!result.IsError()); | 545 EXPECT(!result.IsError()); |
546 const GrowableObjectArray& libs = GrowableObjectArray::Handle( | 546 const GrowableObjectArray& libs = GrowableObjectArray::Handle( |
547 Isolate::Current()->object_store()->libraries()); | 547 Isolate::Current()->object_store()->libraries()); |
548 ASSERT(!libs.IsNull()); | 548 ASSERT(!libs.IsNull()); |
549 // App lib is the last one that was loaded. | 549 // App lib is the last one that was loaded. |
550 intptr_t num_libs = libs.Length(); | 550 intptr_t num_libs = libs.Length(); |
551 Library& app_lib = Library::Handle(); | 551 Library& app_lib = Library::Handle(); |
552 app_lib ^= libs.At(num_libs - 1); | 552 app_lib ^= libs.At(num_libs - 1); |
553 ASSERT(!app_lib.IsNull()); | 553 ASSERT(!app_lib.IsNull()); |
554 const Class& cls = Class::Handle( | 554 const Class& cls = Class::Handle( |
555 app_lib.LookupClass(String::Handle(Symbols::New("A")))); | 555 app_lib.LookupClass(String::Handle(Symbols::New("A")), NULL)); |
556 EXPECT_EQ(cls.raw(), result.clazz()); | 556 EXPECT_EQ(cls.raw(), result.clazz()); |
557 } | 557 } |
558 | 558 |
559 } // namespace dart | 559 } // namespace dart |
OLD | NEW |