| 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/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
| 10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
| (...skipping 13246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13257 _library = new Library(context, _listener, librarySource); | 13257 _library = new Library(context, _listener, librarySource); |
| 13258 LibraryElementImpl element = new LibraryElementImpl.forNode( | 13258 LibraryElementImpl element = new LibraryElementImpl.forNode( |
| 13259 context, | 13259 context, |
| 13260 AstFactory.libraryIdentifier2(["lib"])); | 13260 AstFactory.libraryIdentifier2(["lib"])); |
| 13261 element.definingCompilationUnit = | 13261 element.definingCompilationUnit = |
| 13262 new CompilationUnitElementImpl("lib.dart"); | 13262 new CompilationUnitElementImpl("lib.dart"); |
| 13263 _library.libraryElement = element; | 13263 _library.libraryElement = element; |
| 13264 _typeProvider = new TestTypeProvider(); | 13264 _typeProvider = new TestTypeProvider(); |
| 13265 _visitor = | 13265 _visitor = |
| 13266 new TypeResolverVisitor.con1(_library, librarySource, _typeProvider); | 13266 new TypeResolverVisitor.con1(_library, librarySource, _typeProvider); |
| 13267 _implicitConstructorBuilder = | 13267 _implicitConstructorBuilder = new ImplicitConstructorBuilder( |
| 13268 new ImplicitConstructorBuilder.con1(_library, librarySource, _typeProvid
er); | 13268 librarySource, |
| 13269 _library.libraryElement, |
| 13270 _library.libraryScope, |
| 13271 _typeProvider, |
| 13272 (ClassElement classElement, ClassElement superclassElement, void computa
tion()) |
| 13273 { |
| 13274 // For these tests, we assume the classes for which implicit |
| 13275 // constructors need to be built are visited in proper dependency order, |
| 13276 // so we just invoke the computation immediately. |
| 13277 computation(); |
| 13278 }); |
| 13269 } | 13279 } |
| 13270 | 13280 |
| 13271 void test_visitCatchClause_exception() { | 13281 void test_visitCatchClause_exception() { |
| 13272 // catch (e) | 13282 // catch (e) |
| 13273 CatchClause clause = AstFactory.catchClause("e"); | 13283 CatchClause clause = AstFactory.catchClause("e"); |
| 13274 SimpleIdentifier exceptionParameter = clause.exceptionParameter; | 13284 SimpleIdentifier exceptionParameter = clause.exceptionParameter; |
| 13275 exceptionParameter.staticElement = | 13285 exceptionParameter.staticElement = |
| 13276 new LocalVariableElementImpl.forNode(exceptionParameter); | 13286 new LocalVariableElementImpl.forNode(exceptionParameter); |
| 13277 _resolveCatchClause(clause, _typeProvider.dynamicType, null); | 13287 _resolveCatchClause(clause, _typeProvider.dynamicType, null); |
| 13278 _listener.assertNoErrors(); | 13288 _listener.assertNoErrors(); |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13765 // check propagated type | 13775 // check propagated type |
| 13766 FunctionType propagatedType = node.propagatedType as FunctionType; | 13776 FunctionType propagatedType = node.propagatedType as FunctionType; |
| 13767 expect(propagatedType.returnType, test.typeProvider.stringType); | 13777 expect(propagatedType.returnType, test.typeProvider.stringType); |
| 13768 } on AnalysisException catch (e, stackTrace) { | 13778 } on AnalysisException catch (e, stackTrace) { |
| 13769 thrownException[0] = new CaughtException(e, stackTrace); | 13779 thrownException[0] = new CaughtException(e, stackTrace); |
| 13770 } | 13780 } |
| 13771 } | 13781 } |
| 13772 return null; | 13782 return null; |
| 13773 } | 13783 } |
| 13774 } | 13784 } |
| OLD | NEW |