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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 String& url = String::Handle(String::New("dart-test:Parser_TopLevel")); | 116 String& url = String::Handle(String::New("dart-test:Parser_TopLevel")); |
117 String& source = String::Handle(String::New(script_chars)); | 117 String& source = String::Handle(String::New(script_chars)); |
118 Script& script = Script::Handle(Script::New(url, | 118 Script& script = Script::Handle(Script::New(url, |
119 source, | 119 source, |
120 RawScript::kSourceTag)); | 120 RawScript::kSourceTag)); |
121 Library& lib = Library::ZoneHandle(Library::CoreLibrary()); | 121 Library& lib = Library::ZoneHandle(Library::CoreLibrary()); |
122 | 122 |
123 script.Tokenize(String::Handle(String::New(""))); | 123 script.Tokenize(String::Handle(String::New(""))); |
124 | 124 |
125 Parser::ParseCompilationUnit(lib, script); | 125 Parser::ParseCompilationUnit( |
126 EXPECT(ClassFinalizer::FinalizePendingClasses()); | 126 lib, script, ClassFinalizer::kNotGeneratingSnapshot); |
| 127 EXPECT(ClassFinalizer::FinalizeAllClasses()); |
127 CheckField(lib, "A", "f1", false, false); | 128 CheckField(lib, "A", "f1", false, false); |
128 CheckField(lib, "A", "f2", false, true); | 129 CheckField(lib, "A", "f2", false, true); |
129 CheckField(lib, "A", "f3", false, true); | 130 CheckField(lib, "A", "f3", false, true); |
130 CheckField(lib, "A", "f4", false, true); | 131 CheckField(lib, "A", "f4", false, true); |
131 CheckField(lib, "A", "s1", true, false); | 132 CheckField(lib, "A", "s1", true, false); |
132 CheckField(lib, "A", "s2", true, false); | 133 CheckField(lib, "A", "s2", true, false); |
133 CheckField(lib, "A", "s3", true, true); | 134 CheckField(lib, "A", "s3", true, true); |
134 CheckFunction(lib, "A", "bar", true); | 135 CheckFunction(lib, "A", "bar", true); |
135 CheckFunction(lib, "A", "foo", true); | 136 CheckFunction(lib, "A", "foo", true); |
136 } | 137 } |
(...skipping 13 matching lines...) Expand all Loading... |
150 | 151 |
151 String& url = String::Handle(String::New("dart-test:Parser_TopLevel")); | 152 String& url = String::Handle(String::New("dart-test:Parser_TopLevel")); |
152 String& source = String::Handle(String::New(script_chars)); | 153 String& source = String::Handle(String::New(script_chars)); |
153 Script& script = Script::Handle(Script::New(url, | 154 Script& script = Script::Handle(Script::New(url, |
154 source, | 155 source, |
155 RawScript::kSourceTag)); | 156 RawScript::kSourceTag)); |
156 Library& lib = Library::ZoneHandle(Library::CoreLibrary()); | 157 Library& lib = Library::ZoneHandle(Library::CoreLibrary()); |
157 | 158 |
158 script.Tokenize(String::Handle(String::New(""))); | 159 script.Tokenize(String::Handle(String::New(""))); |
159 | 160 |
160 Parser::ParseCompilationUnit(lib, script); | 161 Parser::ParseCompilationUnit( |
161 EXPECT(ClassFinalizer::FinalizePendingClasses()); | 162 lib, script, ClassFinalizer::kNotGeneratingSnapshot); |
| 163 EXPECT(ClassFinalizer::FinalizeAllClasses()); |
162 | 164 |
163 DumpFunction(lib, "A", "foo"); | 165 DumpFunction(lib, "A", "foo"); |
164 DumpFunction(lib, "A", "bar"); | 166 DumpFunction(lib, "A", "bar"); |
165 DumpFunction(lib, "A", "baz"); | 167 DumpFunction(lib, "A", "baz"); |
166 DumpFunction(lib, "B", "bam"); | 168 DumpFunction(lib, "B", "bam"); |
167 } | 169 } |
168 | 170 |
169 } // namespace dart | 171 } // namespace dart |
OLD | NEW |