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

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

Issue 448943004: Refactor and simplify the dart2dart renamer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rely (almost) only on Entity from renamer. Improve handling of privates and constructors. Avoid sor… Created 6 years, 4 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
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/implementation/resolution/resolution.dart"; 10 import "package:compiler/implementation/resolution/resolution.dart";
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 Expect.equals(2, length(c.interfaces)); 602 Expect.equals(2, length(c.interfaces));
603 Expect.equals(i1.computeType(compiler), at(c.interfaces, 0)); 603 Expect.equals(i1.computeType(compiler), at(c.interfaces, 0));
604 Expect.equals(i2.computeType(compiler), at(c.interfaces, 1)); 604 Expect.equals(i2.computeType(compiler), at(c.interfaces, 1));
605 }); 605 });
606 } 606 }
607 607
608 Future testFunctionExpression() { 608 Future testFunctionExpression() {
609 return MockCompiler.create((MockCompiler compiler) { 609 return MockCompiler.create((MockCompiler compiler) {
610 ResolverVisitor visitor = compiler.resolverVisitor(); 610 ResolverVisitor visitor = compiler.resolverVisitor();
611 Map mapping = compiler.resolveStatement("int f() {}").map; 611 Map mapping = compiler.resolveStatement("int f() {}").map;
612 Expect.equals(1, mapping.length); 612 Expect.equals(2, mapping.length);
613 Element element; 613 Element element;
614 Node node; 614 Node node;
615 mapping.forEach((Node n, Element e) { 615 mapping.forEach((Node n, Element e) {
616 if (n is FunctionExpression) { 616 if (n is FunctionExpression) {
617 element = e; 617 element = e;
618 node = n; 618 node = n;
619 } 619 }
620 }); 620 });
621 Expect.equals(ElementKind.FUNCTION, element.kind); 621 Expect.equals(ElementKind.FUNCTION, element.kind);
622 Expect.equals('f', element.name); 622 Expect.equals('f', element.name);
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 }"""; 1064 }""";
1065 asyncTest(() => compileScript(script2).then((compiler) { 1065 asyncTest(() => compileScript(script2).then((compiler) {
1066 expect(compiler, 1066 expect(compiler,
1067 [MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS], 1067 [MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS],
1068 [MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR, 1068 [MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR,
1069 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR, 1069 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR,
1070 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD, 1070 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD,
1071 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD]); 1071 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD]);
1072 })); 1072 }));
1073 } 1073 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698