| 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.generated.analysis_context_factory; | 5 library analyzer.test.generated.analysis_context_factory; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 ElementFactory.classElement2("Completer", ["T"]); | 231 ElementFactory.classElement2("Completer", ["T"]); |
| 232 ConstructorElementImpl completerConstructor = | 232 ConstructorElementImpl completerConstructor = |
| 233 ElementFactory.constructorElement2(completerElement, null); | 233 ElementFactory.constructorElement2(completerElement, null); |
| 234 completerElement.constructors = <ConstructorElement>[completerConstructor]; | 234 completerElement.constructors = <ConstructorElement>[completerConstructor]; |
| 235 // StreamSubscription | 235 // StreamSubscription |
| 236 ClassElementImpl streamSubscriptionElement = | 236 ClassElementImpl streamSubscriptionElement = |
| 237 ElementFactory.classElement2("StreamSubscription", ["T"]); | 237 ElementFactory.classElement2("StreamSubscription", ["T"]); |
| 238 // Stream | 238 // Stream |
| 239 ClassElementImpl streamElement = | 239 ClassElementImpl streamElement = |
| 240 ElementFactory.classElement2("Stream", ["T"]); | 240 ElementFactory.classElement2("Stream", ["T"]); |
| 241 streamElement.abstract = true; |
| 241 streamElement.constructors = <ConstructorElement>[ | 242 streamElement.constructors = <ConstructorElement>[ |
| 242 ElementFactory.constructorElement2(streamElement, null) | 243 ElementFactory.constructorElement2(streamElement, null) |
| 243 ]; | 244 ]; |
| 244 DartType returnType = streamSubscriptionElement.type | 245 DartType returnType = streamSubscriptionElement.type |
| 245 .instantiate(streamElement.type.typeArguments); | 246 .instantiate(streamElement.type.typeArguments); |
| 246 FunctionElementImpl listenOnData = ElementFactory.functionElement3( | 247 FunctionElementImpl listenOnData = ElementFactory.functionElement3( |
| 247 'onData', | 248 'onData', |
| 248 VoidTypeImpl.instance.element, | 249 VoidTypeImpl.instance.element, |
| 249 <TypeDefiningElement>[streamElement.typeParameters[0]], | 250 <TypeDefiningElement>[streamElement.typeParameters[0]], |
| 250 null); | 251 null); |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 | 572 |
| 572 void _addLibrary(LibraryMap map, String uri, bool isInternal, String path) { | 573 void _addLibrary(LibraryMap map, String uri, bool isInternal, String path) { |
| 573 SdkLibraryImpl library = new SdkLibraryImpl(uri); | 574 SdkLibraryImpl library = new SdkLibraryImpl(uri); |
| 574 if (isInternal) { | 575 if (isInternal) { |
| 575 library.category = "Internal"; | 576 library.category = "Internal"; |
| 576 } | 577 } |
| 577 library.path = path; | 578 library.path = path; |
| 578 map.setLibrary(uri, library); | 579 map.setLibrary(uri, library); |
| 579 } | 580 } |
| 580 } | 581 } |
| OLD | NEW |