| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
| 7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
| 8 import 'package:compiler/src/types/types.dart'; | 8 import 'package:compiler/src/types/types.dart'; |
| 9 import 'package:compiler/src/inferrer/concrete_types_inferrer.dart'; | 9 import 'package:compiler/src/inferrer/concrete_types_inferrer.dart'; |
| 10 | 10 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 154 const String DYNAMIC = '"__dynamic_for_test"'; | 154 const String DYNAMIC = '"__dynamic_for_test"'; |
| 155 | 155 |
| 156 Future<AnalysisResult> analyze(String code, {int maxConcreteTypeSize: 1000}) { | 156 Future<AnalysisResult> analyze(String code, {int maxConcreteTypeSize: 1000}) { |
| 157 Uri uri = new Uri(scheme: 'dart', path: 'test'); | 157 Uri uri = new Uri(scheme: 'dart', path: 'test'); |
| 158 MockCompiler compiler = new MockCompiler.internal( | 158 MockCompiler compiler = new MockCompiler.internal( |
| 159 enableConcreteTypeInference: true, | 159 enableConcreteTypeInference: true, |
| 160 maxConcreteTypeSize: maxConcreteTypeSize); | 160 maxConcreteTypeSize: maxConcreteTypeSize); |
| 161 compiler.diagnosticHandler = createHandler(compiler, code); |
| 161 compiler.registerSource(uri, code); | 162 compiler.registerSource(uri, code); |
| 162 compiler.typesTask.concreteTypesInferrer.testMode = true; | 163 compiler.typesTask.concreteTypesInferrer.testMode = true; |
| 163 return compiler.runCompiler(uri).then((_) { | 164 return compiler.runCompiler(uri).then((_) { |
| 164 return new AnalysisResult(compiler); | 165 return new AnalysisResult(compiler); |
| 165 }); | 166 }); |
| 166 } | 167 } |
| 167 | 168 |
| 168 testDynamicBackDoor() { | 169 testDynamicBackDoor() { |
| 169 final String source = """ | 170 final String source = """ |
| 170 main () { | 171 main () { |
| (...skipping 1972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2143 testClosures10, | 2144 testClosures10, |
| 2144 testClosures11, | 2145 testClosures11, |
| 2145 testClosures12, | 2146 testClosures12, |
| 2146 testRefinement, | 2147 testRefinement, |
| 2147 testDefaultArguments, | 2148 testDefaultArguments, |
| 2148 testSuperConstructorCall, | 2149 testSuperConstructorCall, |
| 2149 testSuperConstructorCall2, | 2150 testSuperConstructorCall2, |
| 2150 testSuperConstructorCall3, | 2151 testSuperConstructorCall3, |
| 2151 ], (f) => f())); | 2152 ], (f) => f())); |
| 2152 } | 2153 } |
| OLD | NEW |