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 library mock_compiler; | 5 library mock_compiler; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:uri'; | 8 import 'dart:uri'; |
9 | 9 |
10 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api; | 10 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 Node parsedTree; | 160 Node parsedTree; |
161 | 161 |
162 MockCompiler({String coreSource: DEFAULT_CORELIB, | 162 MockCompiler({String coreSource: DEFAULT_CORELIB, |
163 String helperSource: DEFAULT_HELPERLIB, | 163 String helperSource: DEFAULT_HELPERLIB, |
164 String interceptorsSource: DEFAULT_INTERCEPTORSLIB, | 164 String interceptorsSource: DEFAULT_INTERCEPTORSLIB, |
165 String isolateHelperSource: DEFAULT_ISOLATE_HELPERLIB, | 165 String isolateHelperSource: DEFAULT_ISOLATE_HELPERLIB, |
166 bool enableTypeAssertions: false, | 166 bool enableTypeAssertions: false, |
167 bool enableMinification: false, | 167 bool enableMinification: false, |
168 bool enableConcreteTypeInference: false, | 168 bool enableConcreteTypeInference: false, |
169 int maxConcreteTypeSize: 5, | 169 int maxConcreteTypeSize: 5, |
170 bool analyzeAll: false}) | 170 bool analyzeAll: false, |
| 171 bool analyzeOnly: false}) |
171 : warnings = [], errors = [], | 172 : warnings = [], errors = [], |
172 sourceFiles = new Map<String, SourceFile>(), | 173 sourceFiles = new Map<String, SourceFile>(), |
173 super(enableTypeAssertions: enableTypeAssertions, | 174 super(enableTypeAssertions: enableTypeAssertions, |
174 enableMinification: enableMinification, | 175 enableMinification: enableMinification, |
175 enableConcreteTypeInference: enableConcreteTypeInference, | 176 enableConcreteTypeInference: enableConcreteTypeInference, |
176 maxConcreteTypeSize: maxConcreteTypeSize, | 177 maxConcreteTypeSize: maxConcreteTypeSize, |
177 analyzeAll: analyzeAll) { | 178 analyzeAll: analyzeAll, |
| 179 analyzeOnly: analyzeOnly) { |
178 coreLibrary = createLibrary("core", coreSource); | 180 coreLibrary = createLibrary("core", coreSource); |
179 // We need to set the assert method to avoid calls with a 'null' | 181 // We need to set the assert method to avoid calls with a 'null' |
180 // target being interpreted as a call to assert. | 182 // target being interpreted as a call to assert. |
181 jsHelperLibrary = createLibrary("helper", helperSource); | 183 jsHelperLibrary = createLibrary("helper", helperSource); |
182 foreignLibrary = createLibrary("foreign", FOREIGN_LIBRARY); | 184 foreignLibrary = createLibrary("foreign", FOREIGN_LIBRARY); |
183 interceptorsLibrary = createLibrary("interceptors", interceptorsSource); | 185 interceptorsLibrary = createLibrary("interceptors", interceptorsSource); |
184 isolateHelperLibrary = createLibrary("isolate_helper", isolateHelperSource); | 186 isolateHelperLibrary = createLibrary("isolate_helper", isolateHelperSource); |
185 | 187 |
186 // Set up the library imports. | 188 // Set up the library imports. |
187 importHelperLibrary(coreLibrary); | 189 importHelperLibrary(coreLibrary); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 } | 384 } |
383 } | 385 } |
384 | 386 |
385 class MockDeferredLoadTask extends DeferredLoadTask { | 387 class MockDeferredLoadTask extends DeferredLoadTask { |
386 MockDeferredLoadTask(Compiler compiler) : super(compiler); | 388 MockDeferredLoadTask(Compiler compiler) : super(compiler); |
387 | 389 |
388 void registerMainApp(LibraryElement mainApp) { | 390 void registerMainApp(LibraryElement mainApp) { |
389 // Do nothing. | 391 // Do nothing. |
390 } | 392 } |
391 } | 393 } |
OLD | NEW |