Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: tests/compiler/dart2js/resolver_test.dart

Issue 883223003: Minor cleanup in resolver_test.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 {List expectedWarnings: const [], 678 {List expectedWarnings: const [],
679 List expectedErrors: const [], 679 List expectedErrors: const [],
680 List expectedInfos: const [], 680 List expectedInfos: const [],
681 Map<String, String> corelib}) { 681 Map<String, String> corelib}) {
682 MockCompiler compiler = new MockCompiler.internal(coreSource: corelib); 682 MockCompiler compiler = new MockCompiler.internal(coreSource: corelib);
683 return compiler.init().then((_) { 683 return compiler.init().then((_) {
684 compiler.parseScript(script); 684 compiler.parseScript(script);
685 compiler.resolveStatement(statement); 685 compiler.resolveStatement(statement);
686 ClassElement classElement = compiler.mainApp.find(className); 686 ClassElement classElement = compiler.mainApp.find(className);
687 Element element; 687 Element element;
688 if (constructor != '') { 688 element = classElement.lookupConstructor(constructor);
689 element = classElement.lookupConstructor(constructor);
690 } else {
691 element = classElement.lookupDefaultConstructor();
692 }
693
694 FunctionExpression tree = (element as FunctionElement).node; 689 FunctionExpression tree = (element as FunctionElement).node;
695 ResolverVisitor visitor = 690 ResolverVisitor visitor =
696 new ResolverVisitor(compiler, element, 691 new ResolverVisitor(compiler, element,
697 new ResolutionRegistry.internal(compiler, 692 new ResolutionRegistry.internal(compiler,
698 new CollectingTreeElements(element))); 693 new CollectingTreeElements(element)));
699 new InitializerResolver(visitor).resolveInitializers(element, tree); 694 new InitializerResolver(visitor).resolveInitializers(element, tree);
700 visitor.visit(tree.body); 695 visitor.visit(tree.body);
701 Expect.equals(expectedElementCount, map(visitor).length); 696 Expect.equals(expectedElementCount, map(visitor).length);
702 697
703 compareWarningKinds(script, expectedWarnings, compiler.warnings); 698 compareWarningKinds(script, expectedWarnings, compiler.warnings);
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 }"""; 1135 }""";
1141 asyncTest(() => compileScript(script2).then((compiler) { 1136 asyncTest(() => compileScript(script2).then((compiler) {
1142 expect(compiler, 1137 expect(compiler,
1143 [MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS], 1138 [MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS],
1144 [MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR, 1139 [MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR,
1145 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR, 1140 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR,
1146 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD, 1141 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD,
1147 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD]); 1142 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD]);
1148 })); 1143 }));
1149 } 1144 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698