| 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.context.context; | 5 library analyzer.src.context.context; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 /** | 717 /** |
| 718 * Create a minimalistic mock dart:async library | 718 * Create a minimalistic mock dart:async library |
| 719 * to stand in for a real one if one does not exist | 719 * to stand in for a real one if one does not exist |
| 720 * facilitating creation a type provider without dart:async. | 720 * facilitating creation a type provider without dart:async. |
| 721 */ | 721 */ |
| 722 LibraryElement createMockAsyncLib(LibraryElement coreLibrary) { | 722 LibraryElement createMockAsyncLib(LibraryElement coreLibrary) { |
| 723 InterfaceType objType = coreLibrary.getType('Object').type; | 723 InterfaceType objType = coreLibrary.getType('Object').type; |
| 724 | 724 |
| 725 ClassElement _classElement(String typeName, [List<String> parameterNames]) { | 725 ClassElement _classElement(String typeName, [List<String> parameterNames]) { |
| 726 ClassElementImpl element = | 726 ClassElementImpl element = |
| 727 new ClassElementImpl.forNode(AstFactory.identifier3(typeName)); | 727 new ClassElementImpl_Class.forNode(AstFactory.identifier3(typeName)); |
| 728 element.supertype = objType; | 728 element.supertype = objType; |
| 729 InterfaceTypeImpl type = new InterfaceTypeImpl(element); | 729 InterfaceTypeImpl type = new InterfaceTypeImpl(element); |
| 730 element.type = type; | 730 element.type = type; |
| 731 if (parameterNames != null) { | 731 if (parameterNames != null) { |
| 732 int count = parameterNames.length; | 732 int count = parameterNames.length; |
| 733 if (count > 0) { | 733 if (count > 0) { |
| 734 List<TypeParameterElementImpl> typeParameters = | 734 List<TypeParameterElementImpl> typeParameters = |
| 735 new List<TypeParameterElementImpl>(count); | 735 new List<TypeParameterElementImpl>(count); |
| 736 List<TypeParameterTypeImpl> typeArguments = | 736 List<TypeParameterTypeImpl> typeArguments = |
| 737 new List<TypeParameterTypeImpl>(count); | 737 new List<TypeParameterTypeImpl>(count); |
| (...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2213 } | 2213 } |
| 2214 DartSdk sdk = factory.dartSdk; | 2214 DartSdk sdk = factory.dartSdk; |
| 2215 if (sdk == null) { | 2215 if (sdk == null) { |
| 2216 throw new IllegalArgumentException( | 2216 throw new IllegalArgumentException( |
| 2217 "The source factory for an SDK analysis context must have a DartUriRes
olver"); | 2217 "The source factory for an SDK analysis context must have a DartUriRes
olver"); |
| 2218 } | 2218 } |
| 2219 return new AnalysisCache( | 2219 return new AnalysisCache( |
| 2220 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); | 2220 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); |
| 2221 } | 2221 } |
| 2222 } | 2222 } |
| OLD | NEW |