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 "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:collection'; | 9 import 'dart:collection'; |
10 | 10 |
11 import 'package:compiler/compiler.dart' as api; | 11 import 'package:compiler/compiler.dart' as api; |
12 import 'package:compiler/src/common/names.dart' show | 12 import 'package:compiler/src/common/names.dart' show |
13 Uris; | 13 Uris; |
14 import 'package:compiler/src/constants/expressions.dart'; | 14 import 'package:compiler/src/constants/expressions.dart'; |
| 15 import 'package:compiler/src/diagnostics/diagnostic_listener.dart'; |
15 import 'package:compiler/src/diagnostics/messages.dart'; | 16 import 'package:compiler/src/diagnostics/messages.dart'; |
16 import 'package:compiler/src/diagnostics/source_span.dart'; | 17 import 'package:compiler/src/diagnostics/source_span.dart'; |
17 import 'package:compiler/src/diagnostics/spannable.dart'; | 18 import 'package:compiler/src/diagnostics/spannable.dart'; |
18 import 'package:compiler/src/elements/elements.dart'; | 19 import 'package:compiler/src/elements/elements.dart'; |
19 import 'package:compiler/src/js_backend/js_backend.dart' | 20 import 'package:compiler/src/js_backend/js_backend.dart' |
20 show JavaScriptBackend; | 21 show JavaScriptBackend; |
21 import 'package:compiler/src/io/source_file.dart'; | 22 import 'package:compiler/src/io/source_file.dart'; |
22 import 'package:compiler/src/resolution/members.dart'; | 23 import 'package:compiler/src/resolution/members.dart'; |
23 import 'package:compiler/src/resolution/registry.dart'; | 24 import 'package:compiler/src/resolution/registry.dart'; |
24 import 'package:compiler/src/resolution/scope.dart'; | 25 import 'package:compiler/src/resolution/scope.dart'; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 enableUserAssertions: enableUserAssertions, | 99 enableUserAssertions: enableUserAssertions, |
99 enableAssertMessage: true, | 100 enableAssertMessage: true, |
100 enableMinification: enableMinification, | 101 enableMinification: enableMinification, |
101 maxConcreteTypeSize: maxConcreteTypeSize, | 102 maxConcreteTypeSize: maxConcreteTypeSize, |
102 disableTypeInferenceFlag: disableTypeInference, | 103 disableTypeInferenceFlag: disableTypeInference, |
103 analyzeAllFlag: analyzeAll, | 104 analyzeAllFlag: analyzeAll, |
104 analyzeOnly: analyzeOnly, | 105 analyzeOnly: analyzeOnly, |
105 emitJavaScript: emitJavaScript, | 106 emitJavaScript: emitJavaScript, |
106 preserveComments: preserveComments, | 107 preserveComments: preserveComments, |
107 trustTypeAnnotations: trustTypeAnnotations, | 108 trustTypeAnnotations: trustTypeAnnotations, |
108 showPackageWarnings: true, | 109 diagnosticOptions: |
| 110 new DiagnosticOptions(showPackageWarnings: true), |
109 outputProvider: new LegacyCompilerOutput(outputProvider)) { | 111 outputProvider: new LegacyCompilerOutput(outputProvider)) { |
110 this.disableInlining = disableInlining; | 112 this.disableInlining = disableInlining; |
111 | 113 |
112 deferredLoadTask = new MockDeferredLoadTask(this); | 114 deferredLoadTask = new MockDeferredLoadTask(this); |
113 | 115 |
114 clearMessages(); | 116 clearMessages(); |
115 | 117 |
116 registerSource(Uris.dart_core, | 118 registerSource(Uris.dart_core, |
117 buildLibrarySource(DEFAULT_CORE_LIBRARY, coreSource)); | 119 buildLibrarySource(DEFAULT_CORE_LIBRARY, coreSource)); |
118 registerSource(PATCH_CORE, DEFAULT_PATCH_CORE_SOURCE); | 120 registerSource(PATCH_CORE, DEFAULT_PATCH_CORE_SOURCE); |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 trustTypeAnnotations: trustTypeAnnotations, | 467 trustTypeAnnotations: trustTypeAnnotations, |
466 enableTypeAssertions: enableTypeAssertions, | 468 enableTypeAssertions: enableTypeAssertions, |
467 enableUserAssertions: enableUserAssertions, | 469 enableUserAssertions: enableUserAssertions, |
468 expectedErrors: expectedErrors, | 470 expectedErrors: expectedErrors, |
469 expectedWarnings: expectedWarnings, | 471 expectedWarnings: expectedWarnings, |
470 outputProvider: outputProvider); | 472 outputProvider: outputProvider); |
471 compiler.registerSource(uri, code); | 473 compiler.registerSource(uri, code); |
472 compiler.diagnosticHandler = createHandler(compiler, code); | 474 compiler.diagnosticHandler = createHandler(compiler, code); |
473 return compiler; | 475 return compiler; |
474 } | 476 } |
OLD | NEW |