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

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

Issue 1383503002: Add Resolution and Parsing interfaces for computeType, ensureResolved and parseNode. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add TODOs. Created 5 years, 2 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
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 "dart:async"; 5 import "dart:async";
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 import "package:async_helper/async_helper.dart"; 7 import "package:async_helper/async_helper.dart";
8 import "package:compiler/src/diagnostics/messages.dart"; 8 import "package:compiler/src/diagnostics/messages.dart";
9 import "package:compiler/src/elements/elements.dart"; 9 import "package:compiler/src/elements/elements.dart";
10 import "package:compiler/src/resolution/members.dart"; 10 import "package:compiler/src/resolution/members.dart";
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 Future testErrorHandling() { 43 Future testErrorHandling() {
44 // Test that compiler.currentElement is set correctly when 44 // Test that compiler.currentElement is set correctly when
45 // reporting errors/warnings. 45 // reporting errors/warnings.
46 CallbackMockCompiler compiler = new CallbackMockCompiler(); 46 CallbackMockCompiler compiler = new CallbackMockCompiler();
47 return compiler.init().then((_) { 47 return compiler.init().then((_) {
48 ResolverVisitor visitor = compiler.resolverVisitor(); 48 ResolverVisitor visitor = compiler.resolverVisitor();
49 compiler.parseScript('NoSuchPrefix.NoSuchType foo() {}'); 49 compiler.parseScript('NoSuchPrefix.NoSuchType foo() {}');
50 FunctionElement foo = compiler.mainApp.find('foo'); 50 FunctionElement foo = compiler.mainApp.find('foo');
51 compiler.setOnWarning( 51 compiler.setOnWarning(
52 (c, n, m) => Expect.equals(foo, compiler.currentElement)); 52 (c, n, m) => Expect.equals(foo, compiler.currentElement));
53 foo.computeType(compiler); 53 foo.computeType(compiler.resolution);
54 Expect.equals(1, compiler.warnings.length); 54 Expect.equals(1, compiler.warnings.length);
55 }); 55 });
56 } 56 }
57 57
58 main() { 58 main() {
59 asyncTest(() => testErrorHandling()); 59 asyncTest(() => testErrorHandling());
60 } 60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698