| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 analyzer.test.src.summary.summarize_ast_test; | 5 library analyzer.test.src.summary.summarize_ast_test; |
| 6 | 6 |
| 7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
| 8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
| 9 import 'package:analyzer/dart/ast/token.dart'; | 9 import 'package:analyzer/dart/ast/token.dart'; |
| 10 import 'package:analyzer/src/dart/scanner/reader.dart'; | 10 import 'package:analyzer/src/dart/scanner/reader.dart'; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 return linkedLibrary; | 198 return linkedLibrary; |
| 199 } | 199 } |
| 200 UnlinkedUnit getUnit(String absoluteUri) { | 200 UnlinkedUnit getUnit(String absoluteUri) { |
| 201 UnlinkedUnit unit = uriToUnit[absoluteUri] ?? | 201 UnlinkedUnit unit = uriToUnit[absoluteUri] ?? |
| 202 SerializedMockSdk.instance.uriToUnlinkedUnit[absoluteUri]; | 202 SerializedMockSdk.instance.uriToUnlinkedUnit[absoluteUri]; |
| 203 if (unit == null && !allowMissingFiles) { | 203 if (unit == null && !allowMissingFiles) { |
| 204 fail('Linker unexpectedly requested unit for "$absoluteUri".'); | 204 fail('Linker unexpectedly requested unit for "$absoluteUri".'); |
| 205 } | 205 } |
| 206 return unit; | 206 return unit; |
| 207 } | 207 } |
| 208 linked = link(uriToUnit.keys.toSet(), getDependency, getUnit)[ | 208 linked = link(uriToUnit.keys.toSet(), getDependency, getUnit, strongMode)[ |
| 209 testDartUri.toString()]; | 209 testDartUri.toString()]; |
| 210 expect(linked, isNotNull); | 210 expect(linked, isNotNull); |
| 211 validateLinkedLibrary(linked); | 211 validateLinkedLibrary(linked); |
| 212 unlinkedUnits = <UnlinkedUnit>[definingUnit]; | 212 unlinkedUnits = <UnlinkedUnit>[definingUnit]; |
| 213 for (String relativeUri in definingUnit.publicNamespace.parts) { | 213 for (String relativeUri in definingUnit.publicNamespace.parts) { |
| 214 UnlinkedUnit unit = uriToUnit[ | 214 UnlinkedUnit unit = uriToUnit[ |
| 215 resolveRelativeUri(testDartUri, Uri.parse(relativeUri)).toString()]; | 215 resolveRelativeUri(testDartUri, Uri.parse(relativeUri)).toString()]; |
| 216 if (unit == null) { | 216 if (unit == null) { |
| 217 if (!allowMissingFiles) { | 217 if (!allowMissingFiles) { |
| 218 fail('Test referred to unknown unit $relativeUri'); | 218 fail('Test referred to unknown unit $relativeUri'); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 233 CompilationUnit _parseText(String text) { | 233 CompilationUnit _parseText(String text) { |
| 234 CharSequenceReader reader = new CharSequenceReader(text); | 234 CharSequenceReader reader = new CharSequenceReader(text); |
| 235 Scanner scanner = | 235 Scanner scanner = |
| 236 new Scanner(null, reader, AnalysisErrorListener.NULL_LISTENER); | 236 new Scanner(null, reader, AnalysisErrorListener.NULL_LISTENER); |
| 237 Token token = scanner.tokenize(); | 237 Token token = scanner.tokenize(); |
| 238 Parser parser = new Parser(null, AnalysisErrorListener.NULL_LISTENER); | 238 Parser parser = new Parser(null, AnalysisErrorListener.NULL_LISTENER); |
| 239 parser.parseGenericMethods = true; | 239 parser.parseGenericMethods = true; |
| 240 return parser.parseCompilationUnit(token); | 240 return parser.parseCompilationUnit(token); |
| 241 } | 241 } |
| 242 } | 242 } |
| OLD | NEW |