OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import "package:compiler/src/resolution/resolution.dart"; | 10 import "package:compiler/src/resolution/resolution.dart"; |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 ClassElement classElement = compiler.mainApp.find(className); | 689 ClassElement classElement = compiler.mainApp.find(className); |
690 Element element; | 690 Element element; |
691 element = classElement.lookupConstructor(constructor); | 691 element = classElement.lookupConstructor(constructor); |
692 FunctionExpression tree = (element as FunctionElement).node; | 692 FunctionExpression tree = (element as FunctionElement).node; |
693 ResolverVisitor visitor = | 693 ResolverVisitor visitor = |
694 new ResolverVisitor(compiler, element, | 694 new ResolverVisitor(compiler, element, |
695 new ResolutionRegistry.internal(compiler, | 695 new ResolutionRegistry.internal(compiler, |
696 new CollectingTreeElements(element))); | 696 new CollectingTreeElements(element))); |
697 new InitializerResolver(visitor).resolveInitializers(element, tree); | 697 new InitializerResolver(visitor).resolveInitializers(element, tree); |
698 visitor.visit(tree.body); | 698 visitor.visit(tree.body); |
699 Expect.equals(expectedElementCount, map(visitor).length); | 699 Expect.equals(expectedElementCount, map(visitor).length, |
| 700 "${map(visitor).values} for '$statement' in context of `$script`"); |
700 | 701 |
701 compareWarningKinds(script, expectedWarnings, compiler.warnings); | 702 compareWarningKinds(script, expectedWarnings, compiler.warnings); |
702 compareWarningKinds(script, expectedErrors, compiler.errors); | 703 compareWarningKinds(script, expectedErrors, compiler.errors); |
703 compareWarningKinds(script, expectedInfos, compiler.infos); | 704 compareWarningKinds(script, expectedInfos, compiler.infos); |
704 }); | 705 }); |
705 } | 706 } |
706 | 707 |
707 Future testClassHierarchy() { | 708 Future testClassHierarchy() { |
708 final MAIN = "main"; | 709 final MAIN = "main"; |
709 return Future.wait([ | 710 return Future.wait([ |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1331 } | 1332 } |
1332 main() => A.m(); | 1333 main() => A.m(); |
1333 ''', functionName: 'm'); | 1334 ''', functionName: 'm'); |
1334 check(''' | 1335 check(''' |
1335 class A { | 1336 class A { |
1336 m() => () => await - 3; | 1337 m() => () => await - 3; |
1337 } | 1338 } |
1338 main() => new A().m(); | 1339 main() => new A().m(); |
1339 ''', className: 'A'); | 1340 ''', className: 'A'); |
1340 } | 1341 } |
OLD | NEW |