| 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:uri'; | 7 import 'dart:uri'; |
| 8 | 8 |
| 9 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api; | 9 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api; |
| 10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' | 10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 List<WarningMessage> errors; | 93 List<WarningMessage> errors; |
| 94 final Map<String, SourceFile> sourceFiles; | 94 final Map<String, SourceFile> sourceFiles; |
| 95 Node parsedTree; | 95 Node parsedTree; |
| 96 | 96 |
| 97 MockCompiler({String coreSource: DEFAULT_CORELIB, | 97 MockCompiler({String coreSource: DEFAULT_CORELIB, |
| 98 String helperSource: DEFAULT_HELPERLIB, | 98 String helperSource: DEFAULT_HELPERLIB, |
| 99 String interceptorsSource: DEFAULT_INTERCEPTORSLIB, | 99 String interceptorsSource: DEFAULT_INTERCEPTORSLIB, |
| 100 bool enableTypeAssertions: false, | 100 bool enableTypeAssertions: false, |
| 101 bool enableMinification: false, | 101 bool enableMinification: false, |
| 102 bool enableConcreteTypeInference: false, | 102 bool enableConcreteTypeInference: false, |
| 103 int maxConcreteTypeSize: 5, |
| 103 bool analyzeAll: false}) | 104 bool analyzeAll: false}) |
| 104 : warnings = [], errors = [], | 105 : warnings = [], errors = [], |
| 105 sourceFiles = new Map<String, SourceFile>(), | 106 sourceFiles = new Map<String, SourceFile>(), |
| 106 super(enableTypeAssertions: enableTypeAssertions, | 107 super(enableTypeAssertions: enableTypeAssertions, |
| 107 enableMinification: enableMinification, | 108 enableMinification: enableMinification, |
| 108 enableConcreteTypeInference: enableConcreteTypeInference, | 109 enableConcreteTypeInference: enableConcreteTypeInference, |
| 110 maxConcreteTypeSize: maxConcreteTypeSize, |
| 109 analyzeAll: analyzeAll) { | 111 analyzeAll: analyzeAll) { |
| 110 coreLibrary = createLibrary("core", coreSource); | 112 coreLibrary = createLibrary("core", coreSource); |
| 111 // We need to set the assert method to avoid calls with a 'null' | 113 // We need to set the assert method to avoid calls with a 'null' |
| 112 // target being interpreted as a call to assert. | 114 // target being interpreted as a call to assert. |
| 113 jsHelperLibrary = createLibrary("helper", helperSource); | 115 jsHelperLibrary = createLibrary("helper", helperSource); |
| 114 importHelperLibrary(coreLibrary); | 116 importHelperLibrary(coreLibrary); |
| 115 libraryLoader.importLibrary(jsHelperLibrary, coreLibrary, null); | 117 libraryLoader.importLibrary(jsHelperLibrary, coreLibrary, null); |
| 116 | 118 |
| 117 assertMethod = jsHelperLibrary.find(buildSourceString('assert')); | 119 assertMethod = jsHelperLibrary.find(buildSourceString('assert')); |
| 118 interceptorsLibrary = createLibrary("interceptors", interceptorsSource); | 120 interceptorsLibrary = createLibrary("interceptors", interceptorsSource); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 operator []=(Node node, Element element) { | 274 operator []=(Node node, Element element) { |
| 273 map[node] = element; | 275 map[node] = element; |
| 274 } | 276 } |
| 275 | 277 |
| 276 operator [](Node node) => map[node]; | 278 operator [](Node node) => map[node]; |
| 277 | 279 |
| 278 void remove(Node node) { | 280 void remove(Node node) { |
| 279 map.remove(node); | 281 map.remove(node); |
| 280 } | 282 } |
| 281 } | 283 } |
| OLD | NEW |