| 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 // 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.src.summary.summary_sdk; | 5 library analyzer.src.summary.summary_sdk; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/element/element.dart'; | 7 import 'package:analyzer/dart/element/element.dart'; |
| 8 import 'package:analyzer/dart/element/type.dart'; | 8 import 'package:analyzer/dart/element/type.dart'; |
| 9 import 'package:analyzer/src/context/cache.dart' show CacheEntry; | 9 import 'package:analyzer/src/context/cache.dart' show CacheEntry; |
| 10 import 'package:analyzer/src/context/context.dart'; | 10 import 'package:analyzer/src/context/context.dart'; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 } | 86 } |
| 87 return false; | 87 return false; |
| 88 } else { | 88 } else { |
| 89 // throw new UnimplementedError('$result of $target'); | 89 // throw new UnimplementedError('$result of $target'); |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 if (target is LibrarySpecificUnit) { | 92 if (target is LibrarySpecificUnit) { |
| 93 if (target.library == null || !target.library.isInSystemLibrary) { | 93 if (target.library == null || !target.library.isInSystemLibrary) { |
| 94 return false; | 94 return false; |
| 95 } | 95 } |
| 96 if (result == CREATED_RESOLVED_UNIT1 || |
| 97 result == CREATED_RESOLVED_UNIT2 || |
| 98 result == CREATED_RESOLVED_UNIT3 || |
| 99 result == CREATED_RESOLVED_UNIT4 || |
| 100 result == CREATED_RESOLVED_UNIT5 || |
| 101 result == CREATED_RESOLVED_UNIT6 || |
| 102 result == CREATED_RESOLVED_UNIT7 || |
| 103 result == CREATED_RESOLVED_UNIT8 || |
| 104 result == CREATED_RESOLVED_UNIT9) { |
| 105 entry.setValue(result, true, TargetedResult.EMPTY_LIST); |
| 106 return true; |
| 107 } |
| 96 if (result == COMPILATION_UNIT_ELEMENT) { | 108 if (result == COMPILATION_UNIT_ELEMENT) { |
| 97 String libraryUri = target.library.uri.toString(); | 109 String libraryUri = target.library.uri.toString(); |
| 98 String unitUri = target.unit.uri.toString(); | 110 String unitUri = target.unit.uri.toString(); |
| 99 CompilationUnitElement unit = resynthesizer.getElement( | 111 CompilationUnitElement unit = resynthesizer.getElement( |
| 100 new ElementLocationImpl.con3(<String>[libraryUri, unitUri])); | 112 new ElementLocationImpl.con3(<String>[libraryUri, unitUri])); |
| 101 if (unit != null) { | 113 if (unit != null) { |
| 102 entry.setValue(result, unit, TargetedResult.EMPTY_LIST); | 114 entry.setValue(result, unit, TargetedResult.EMPTY_LIST); |
| 103 return true; | 115 return true; |
| 104 } | 116 } |
| 105 } | 117 } |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 * throw a [StateError] if there is no class with the given name. | 418 * throw a [StateError] if there is no class with the given name. |
| 407 */ | 419 */ |
| 408 InterfaceType _getType(LibraryElement library, String name) { | 420 InterfaceType _getType(LibraryElement library, String name) { |
| 409 Element element = library.getType(name); | 421 Element element = library.getType(name); |
| 410 if (element == null) { | 422 if (element == null) { |
| 411 throw new StateError("No definition of type $name"); | 423 throw new StateError("No definition of type $name"); |
| 412 } | 424 } |
| 413 return (element as ClassElement).type; | 425 return (element as ClassElement).type; |
| 414 } | 426 } |
| 415 } | 427 } |
| OLD | NEW |