| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 | 2 |
| 3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
| 4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 import 'dart:collection' show HashMap, HashSet; | 6 import 'dart:collection' show HashMap, HashSet; |
| 7 import 'dart:math' show min, max; | 7 import 'dart:math' show min, max; |
| 8 | 8 |
| 9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; | 9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 .isInSystemLibrary)) { | 253 .isInSystemLibrary)) { |
| 254 var sdk = context.sourceFactory.dartSdk; | 254 var sdk = context.sourceFactory.dartSdk; |
| 255 summaryData.addBundle( | 255 summaryData.addBundle( |
| 256 null, | 256 null, |
| 257 sdk is SummaryBasedDartSdk | 257 sdk is SummaryBasedDartSdk |
| 258 ? sdk.bundle | 258 ? sdk.bundle |
| 259 : (sdk as FolderBasedDartSdk).getSummarySdkBundle(true)); | 259 : (sdk as FolderBasedDartSdk).getSummarySdkBundle(true)); |
| 260 } | 260 } |
| 261 | 261 |
| 262 var assembler = new PackageBundleAssembler(); | 262 var assembler = new PackageBundleAssembler(); |
| 263 assembler.recordDependencies(summaryData); | |
| 264 | 263 |
| 265 var uriToUnit = new Map<String, UnlinkedUnit>.fromIterable(units, | 264 var uriToUnit = new Map<String, UnlinkedUnit>.fromIterable(units, |
| 266 key: (u) => u.element.source.uri.toString(), | 265 key: (u) => u.element.source.uri.toString(), |
| 267 value: (unit) { | 266 value: (unit) { |
| 268 var unlinked = serializeAstUnlinked(unit); | 267 var unlinked = serializeAstUnlinked(unit); |
| 269 assembler.addUnlinkedUnit(unit.element.source, unlinked); | 268 assembler.addUnlinkedUnit(unit.element.source, unlinked); |
| 270 return unlinked; | 269 return unlinked; |
| 271 }); | 270 }); |
| 272 | 271 |
| 273 summary_link | 272 summary_link |
| (...skipping 5701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5975 if (targetIdentifier.staticElement is! PrefixElement) return false; | 5974 if (targetIdentifier.staticElement is! PrefixElement) return false; |
| 5976 var prefix = targetIdentifier.staticElement as PrefixElement; | 5975 var prefix = targetIdentifier.staticElement as PrefixElement; |
| 5977 | 5976 |
| 5978 // The library the prefix is referring to must come from a deferred import. | 5977 // The library the prefix is referring to must come from a deferred import. |
| 5979 var containingLibrary = resolutionMap | 5978 var containingLibrary = resolutionMap |
| 5980 .elementDeclaredByCompilationUnit(target.root as CompilationUnit) | 5979 .elementDeclaredByCompilationUnit(target.root as CompilationUnit) |
| 5981 .library; | 5980 .library; |
| 5982 var imports = containingLibrary.getImportsWithPrefix(prefix); | 5981 var imports = containingLibrary.getImportsWithPrefix(prefix); |
| 5983 return imports.length == 1 && imports[0].isDeferred; | 5982 return imports.length == 1 && imports[0].isDeferred; |
| 5984 } | 5983 } |
| OLD | NEW |