| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 engine.resolver_test; | 5 library engine.resolver_test; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/context/context.dart' as newContext; | 9 import 'package:analyzer/src/context/context.dart' as newContext; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 <TypeDefiningElement>[streamElement.typeParameters[0]], null) | 251 <TypeDefiningElement>[streamElement.typeParameters[0]], null) |
| 252 .type, | 252 .type, |
| 253 ]; | 253 ]; |
| 254 // TODO(brianwilkerson) This is missing the optional parameters. | 254 // TODO(brianwilkerson) This is missing the optional parameters. |
| 255 MethodElementImpl listenMethod = | 255 MethodElementImpl listenMethod = |
| 256 ElementFactory.methodElement('listen', returnType, parameterTypes); | 256 ElementFactory.methodElement('listen', returnType, parameterTypes); |
| 257 (listenMethod.type as FunctionTypeImpl).typeArguments = | 257 (listenMethod.type as FunctionTypeImpl).typeArguments = |
| 258 streamElement.type.typeArguments; | 258 streamElement.type.typeArguments; |
| 259 (parameterTypes[0] as FunctionTypeImpl).typeArguments = | 259 (parameterTypes[0] as FunctionTypeImpl).typeArguments = |
| 260 streamElement.type.typeArguments; | 260 streamElement.type.typeArguments; |
| 261 (parameterTypes[0].element as FunctionElementImpl) | 261 (parameterTypes[0].element as FunctionElementImpl).enclosingElement = |
| 262 .enclosingElement = listenMethod; | 262 listenMethod; |
| 263 streamElement.methods = <MethodElement>[listenMethod]; | 263 streamElement.methods = <MethodElement>[listenMethod]; |
| 264 | 264 |
| 265 asyncUnit.types = <ClassElement>[ | 265 asyncUnit.types = <ClassElement>[ |
| 266 completerElement, | 266 completerElement, |
| 267 futureElement, | 267 futureElement, |
| 268 streamElement | 268 streamElement |
| 269 ]; | 269 ]; |
| 270 LibraryElementImpl asyncLibrary = new LibraryElementImpl.forNode( | 270 LibraryElementImpl asyncLibrary = new LibraryElementImpl.forNode( |
| 271 coreContext, AstFactory.libraryIdentifier2(["dart", "async"])); | 271 coreContext, AstFactory.libraryIdentifier2(["dart", "async"])); |
| 272 asyncLibrary.definingCompilationUnit = asyncUnit; | 272 asyncLibrary.definingCompilationUnit = asyncUnit; |
| (...skipping 14850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15123 | 15123 |
| 15124 void _resolveTestUnit(String code) { | 15124 void _resolveTestUnit(String code) { |
| 15125 testCode = code; | 15125 testCode = code; |
| 15126 testSource = addSource(testCode); | 15126 testSource = addSource(testCode); |
| 15127 LibraryElement library = resolve2(testSource); | 15127 LibraryElement library = resolve2(testSource); |
| 15128 assertNoErrors(testSource); | 15128 assertNoErrors(testSource); |
| 15129 verify([testSource]); | 15129 verify([testSource]); |
| 15130 testUnit = resolveCompilationUnit(testSource, library); | 15130 testUnit = resolveCompilationUnit(testSource, library); |
| 15131 } | 15131 } |
| 15132 } | 15132 } |
| OLD | NEW |