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

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

Issue 27510003: Scanner for UTF-8 byte arrays (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixes compiler tests Created 7 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 | 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 "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart"; 6 import "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart";
7 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar t"; 7 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar t";
8 import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution .dart"; 8 import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution .dart";
9 import "../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart"; 9 import "../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart";
10 import "../../../sdk/lib/_internal/compiler/implementation/util/util.dart"; 10 import "../../../sdk/lib/_internal/compiler/implementation/util/util.dart";
(...skipping 21 matching lines...) Expand all
32 super.reportError(node, errorCode, arguments); 32 super.reportError(node, errorCode, arguments);
33 } 33 }
34 } 34 }
35 35
36 testErrorHandling() { 36 testErrorHandling() {
37 // Test that compiler.currentElement is set correctly when 37 // Test that compiler.currentElement is set correctly when
38 // reporting errors/warnings. 38 // reporting errors/warnings.
39 CallbackMockCompiler compiler = new CallbackMockCompiler(); 39 CallbackMockCompiler compiler = new CallbackMockCompiler();
40 ResolverVisitor visitor = compiler.resolverVisitor(); 40 ResolverVisitor visitor = compiler.resolverVisitor();
41 compiler.parseScript('NoSuchPrefix.NoSuchType foo() {}'); 41 compiler.parseScript('NoSuchPrefix.NoSuchType foo() {}');
42 FunctionElement foo = compiler.mainApp.find(buildSourceString('foo')); 42 FunctionElement foo = compiler.mainApp.find('foo');
43 compiler.setOnWarning( 43 compiler.setOnWarning(
44 (c, n, m) => Expect.equals(foo, compiler.currentElement)); 44 (c, n, m) => Expect.equals(foo, compiler.currentElement));
45 foo.computeType(compiler); 45 foo.computeType(compiler);
46 Expect.equals(1, compiler.warnings.length); 46 Expect.equals(1, compiler.warnings.length);
47 } 47 }
48 48
49 main() { 49 main() {
50 testErrorHandling(); 50 testErrorHandling();
51 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698