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

Unified Diff: dart/tests/compiler/dart2js/resolver_test.dart

Issue 821593004: Create erroneous element when resolution of initializer fails. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Tests passing locally. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/pkg/compiler/lib/src/typechecker.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/compiler/dart2js/resolver_test.dart
diff --git a/dart/tests/compiler/dart2js/resolver_test.dart b/dart/tests/compiler/dart2js/resolver_test.dart
index f33e1bbf74f7f25c626f3b7cf3ca0c0fd8beff5f..cd3d0ffd1a72ed05f3dc0075d60e1b2d636974ea 100644
--- a/dart/tests/compiler/dart2js/resolver_test.dart
+++ b/dart/tests/compiler/dart2js/resolver_test.dart
@@ -15,9 +15,6 @@ import 'package:compiler/src/dart_types.dart';
import 'package:compiler/src/elements/modelx.dart';
import 'link_helper.dart';
-import "package:compiler/src/dart2jslib.dart" show
- CompilerCancelledException;
-
Node buildIdentifier(String name) => new Identifier(scan(name));
Node buildInitialization(String name) =>
@@ -281,14 +278,7 @@ Future testThis() {
new CollectingTreeElements(funElement)));
FunctionExpression function =
(funElement as FunctionElementX).parseNode(compiler);
- try {
- visitor.visit(function.body);
- } on CompilerCancelledException catch (_) {
- // Ignored.
-
- // TODO(ahe): Don't ignore CompilerCancelledException, instead, fix
- // pkg/compiler/lib/src/resolution/members.dart.
- }
+ visitor.visit(function.body);
Expect.equals(0, compiler.warnings.length);
Expect.equals(1, compiler.errors.length);
Expect.equals(MessageKind.NO_INSTANCE_AVAILABLE,
@@ -708,15 +698,7 @@ Future resolveConstructor(
new ResolverVisitor(compiler, element,
new ResolutionRegistry.internal(compiler,
new CollectingTreeElements(element)));
- try {
- new InitializerResolver(visitor).resolveInitializers(element, tree);
- } on CompilerCancelledException catch (_) {
- // Ignored.
-
- // TODO(ahe): Don't ignore CompilerCancelledException, instead, fix
- // pkg/compiler/lib/src/resolution/members.dart.
- }
-
+ new InitializerResolver(visitor).resolveInitializers(element, tree);
visitor.visit(tree.body);
Expect.equals(expectedElementCount, map(visitor).length);
@@ -937,7 +919,7 @@ Future testInitializers() {
"""class A {
A() : this.foo = 1;
}""";
- return resolveConstructor(script, "A a = new A();", "A", "", 0,
+ return resolveConstructor(script, "A a = new A();", "A", "", 1,
expectedWarnings: [],
expectedErrors: [MessageKind.CANNOT_RESOLVE]);
},
« no previous file with comments | « dart/pkg/compiler/lib/src/typechecker.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698