| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 || | 96 if (result == CREATED_RESOLVED_UNIT1 || |
| 97 result == CREATED_RESOLVED_UNIT2 || | |
| 98 result == CREATED_RESOLVED_UNIT3 || | 97 result == CREATED_RESOLVED_UNIT3 || |
| 99 result == CREATED_RESOLVED_UNIT4 || | 98 result == CREATED_RESOLVED_UNIT4 || |
| 100 result == CREATED_RESOLVED_UNIT5 || | 99 result == CREATED_RESOLVED_UNIT5 || |
| 101 result == CREATED_RESOLVED_UNIT6 || | 100 result == CREATED_RESOLVED_UNIT6 || |
| 102 result == CREATED_RESOLVED_UNIT7 || | 101 result == CREATED_RESOLVED_UNIT7 || |
| 103 result == CREATED_RESOLVED_UNIT8 || | 102 result == CREATED_RESOLVED_UNIT8 || |
| 104 result == CREATED_RESOLVED_UNIT9) { | 103 result == CREATED_RESOLVED_UNIT9 || |
| 104 result == CREATED_RESOLVED_UNIT10) { |
| 105 entry.setValue(result, true, TargetedResult.EMPTY_LIST); | 105 entry.setValue(result, true, TargetedResult.EMPTY_LIST); |
| 106 return true; | 106 return true; |
| 107 } | 107 } |
| 108 if (result == COMPILATION_UNIT_ELEMENT) { | 108 if (result == COMPILATION_UNIT_ELEMENT) { |
| 109 String libraryUri = target.library.uri.toString(); | 109 String libraryUri = target.library.uri.toString(); |
| 110 String unitUri = target.unit.uri.toString(); | 110 String unitUri = target.unit.uri.toString(); |
| 111 CompilationUnitElement unit = resynthesizer.getElement( | 111 CompilationUnitElement unit = resynthesizer.getElement( |
| 112 new ElementLocationImpl.con3(<String>[libraryUri, unitUri])); | 112 new ElementLocationImpl.con3(<String>[libraryUri, unitUri])); |
| 113 if (unit != null) { | 113 if (unit != null) { |
| 114 entry.setValue(result, unit, TargetedResult.EMPTY_LIST); | 114 entry.setValue(result, unit, TargetedResult.EMPTY_LIST); |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 * 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. |
| 419 */ | 419 */ |
| 420 InterfaceType _getType(LibraryElement library, String name) { | 420 InterfaceType _getType(LibraryElement library, String name) { |
| 421 Element element = library.getType(name); | 421 Element element = library.getType(name); |
| 422 if (element == null) { | 422 if (element == null) { |
| 423 throw new StateError("No definition of type $name"); | 423 throw new StateError("No definition of type $name"); |
| 424 } | 424 } |
| 425 return (element as ClassElement).type; | 425 return (element as ClassElement).type; |
| 426 } | 426 } |
| 427 } | 427 } |
| OLD | NEW |