| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 | 5 |
| 6 #include "vm/ast_printer.h" | 6 #include "vm/ast_printer.h" |
| 7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
| 8 #include "vm/longjump.h" | 8 #include "vm/longjump.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/parser.h" | 10 #include "vm/parser.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 "} \n"; | 113 "} \n"; |
| 114 | 114 |
| 115 String& url = String::Handle(String::New("dart-test:Parser_TopLevel")); | 115 String& url = String::Handle(String::New("dart-test:Parser_TopLevel")); |
| 116 String& source = String::Handle(String::New(script_chars)); | 116 String& source = String::Handle(String::New(script_chars)); |
| 117 Script& script = Script::Handle(Script::New(url, source, RawScript::kSource)); | 117 Script& script = Script::Handle(Script::New(url, source, RawScript::kSource)); |
| 118 Library& lib = Library::ZoneHandle(Library::CoreLibrary()); | 118 Library& lib = Library::ZoneHandle(Library::CoreLibrary()); |
| 119 | 119 |
| 120 script.Tokenize(String::Handle(String::New(""))); | 120 script.Tokenize(String::Handle(String::New(""))); |
| 121 | 121 |
| 122 Parser::ParseCompilationUnit(lib, script); | 122 Parser::ParseCompilationUnit(lib, script); |
| 123 EXPECT(ClassFinalizer::FinalizeAllClasses()); | 123 EXPECT(ClassFinalizer::FinalizePendingClasses()); |
| 124 CheckField(lib, "A", "f1", false, false); | 124 CheckField(lib, "A", "f1", false, false); |
| 125 CheckField(lib, "A", "f2", false, true); | 125 CheckField(lib, "A", "f2", false, true); |
| 126 CheckField(lib, "A", "f3", false, true); | 126 CheckField(lib, "A", "f3", false, true); |
| 127 CheckField(lib, "A", "f4", false, true); | 127 CheckField(lib, "A", "f4", false, true); |
| 128 CheckField(lib, "A", "s1", true, false); | 128 CheckField(lib, "A", "s1", true, false); |
| 129 CheckField(lib, "A", "s2", true, false); | 129 CheckField(lib, "A", "s2", true, false); |
| 130 // No field entries are added for static const fields. | 130 // No field entries are added for static const fields. |
| 131 String& fieldname = String::Handle(String::New("s3")); | 131 String& fieldname = String::Handle(String::New("s3")); |
| 132 const String& classname = String::Handle(String::NewSymbol("A")); | 132 const String& classname = String::Handle(String::NewSymbol("A")); |
| 133 const Class& cls = Class::Handle(lib.LookupClass(classname)); | 133 const Class& cls = Class::Handle(lib.LookupClass(classname)); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 157 "} \n"; | 157 "} \n"; |
| 158 | 158 |
| 159 String& url = String::Handle(String::New("dart-test:Parser_TopLevel")); | 159 String& url = String::Handle(String::New("dart-test:Parser_TopLevel")); |
| 160 String& source = String::Handle(String::New(script_chars)); | 160 String& source = String::Handle(String::New(script_chars)); |
| 161 Script& script = Script::Handle(Script::New(url, source, RawScript::kSource)); | 161 Script& script = Script::Handle(Script::New(url, source, RawScript::kSource)); |
| 162 Library& lib = Library::ZoneHandle(Library::CoreLibrary()); | 162 Library& lib = Library::ZoneHandle(Library::CoreLibrary()); |
| 163 | 163 |
| 164 script.Tokenize(String::Handle(String::New(""))); | 164 script.Tokenize(String::Handle(String::New(""))); |
| 165 | 165 |
| 166 Parser::ParseCompilationUnit(lib, script); | 166 Parser::ParseCompilationUnit(lib, script); |
| 167 EXPECT(ClassFinalizer::FinalizeAllClasses()); | 167 EXPECT(ClassFinalizer::FinalizePendingClasses()); |
| 168 | 168 |
| 169 DumpFunction(lib, "A", "foo"); | 169 DumpFunction(lib, "A", "foo"); |
| 170 DumpFunction(lib, "A", "bar"); | 170 DumpFunction(lib, "A", "bar"); |
| 171 DumpFunction(lib, "A", "baz"); | 171 DumpFunction(lib, "A", "baz"); |
| 172 DumpFunction(lib, "B", "bam"); | 172 DumpFunction(lib, "B", "bam"); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace dart | 175 } // namespace dart |
| OLD | NEW |