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

Unified Diff: tests/compiler/dart2js/type_checker_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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/type_checker_test.dart
diff --git a/tests/compiler/dart2js/type_checker_test.dart b/tests/compiler/dart2js/type_checker_test.dart
index 7404c991d0437da36fc7e5b2ad73665071e90476..00c15d382a587563005ce28eca7c689518204618 100644
--- a/tests/compiler/dart2js/type_checker_test.dart
+++ b/tests/compiler/dart2js/type_checker_test.dart
@@ -13,8 +13,7 @@ import 'parser_helper.dart';
import '../../../sdk/lib/_internal/compiler/implementation/elements/modelx.dart'
show ElementX, CompilationUnitElementX;
-import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart'
- hide SourceString;
+import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart';
import '../../../sdk/lib/_internal/compiler/implementation/dart_types.dart';
@@ -472,13 +471,13 @@ testMethodInvocationsInClass() {
LibraryElement library = mockLibrary(compiler, CLASS_WITH_METHODS);
compiler.parseScript(CLASS_WITH_METHODS, library);
ClassElement ClassWithMethods =
- library.find(const SourceString("ClassWithMethods"));
+ library.find("ClassWithMethods");
ngeoffray 2013/10/18 10:19:37 One line?
lukas 2013/10/24 16:48:36 Done.
ClassWithMethods.ensureResolved(compiler);
- Element c = ClassWithMethods.lookupLocalMember(const SourceString('method'));
+ Element c = ClassWithMethods.lookupLocalMember('method');
assert(c != null);
- ClassElement SubClass = library.find(const SourceString("SubClass"));
+ ClassElement SubClass = library.find("SubClass");
SubClass.ensureResolved(compiler);
- Element d = SubClass.lookupLocalMember(const SourceString('method'));
+ Element d = SubClass.lookupLocalMember('method');
assert(d != null);
check(Element element, String text, [expectedWarnings]){
@@ -740,9 +739,9 @@ testThis() {
}""";
LibraryElement library = mockLibrary(compiler, script);
compiler.parseScript(script, library);
- ClassElement foo = library.find(const SourceString("Foo"));
+ ClassElement foo = library.find("Foo");
foo.ensureResolved(compiler);
- Element method = foo.lookupLocalMember(const SourceString('method'));
+ Element method = foo.lookupLocalMember('method');
analyzeIn(method, "{ int i = this; }", NOT_ASSIGNABLE);
analyzeIn(method, "{ Object o = this; }");
analyzeIn(method, "{ Foo f = this; }");
@@ -761,9 +760,9 @@ testSuper() {
''';
LibraryElement library = mockLibrary(compiler, script);
compiler.parseScript(script, library);
- ClassElement B = library.find(const SourceString("B"));
+ ClassElement B = library.find("B");
B.ensureResolved(compiler);
- Element method = B.lookupLocalMember(const SourceString('method'));
+ Element method = B.lookupLocalMember('method');
analyzeIn(method, "{ int i = super.field; }", NOT_ASSIGNABLE);
analyzeIn(method, "{ Object o = super.field; }");
analyzeIn(method, "{ String s = super.field; }");
@@ -1062,9 +1061,9 @@ void testTypeVariableExpressions() {
}""";
LibraryElement library = mockLibrary(compiler, script);
compiler.parseScript(script, library);
- ClassElement foo = library.find(const SourceString("Foo"));
+ ClassElement foo = library.find("Foo");
foo.ensureResolved(compiler);
- Element method = foo.lookupLocalMember(const SourceString('method'));
+ Element method = foo.lookupLocalMember('method');
analyzeIn(method, "{ Type type = T; }");
analyzeIn(method, "{ T type = T; }", NOT_ASSIGNABLE);
@@ -1095,10 +1094,10 @@ class Test<S extends Foo, T> {
LibraryElement library = mockLibrary(compiler, script);
compiler.parseScript(script, library);
- ClassElement classTest = library.find(const SourceString("Test"));
+ ClassElement classTest = library.find("Test");
classTest.ensureResolved(compiler);
FunctionElement methodTest =
- classTest.lookupLocalMember(const SourceString("test"));
+ classTest.lookupLocalMember("test");
ngeoffray 2013/10/18 10:19:37 One line.
lukas 2013/10/24 16:48:36 Done.
test(String expression, [message]) {
analyzeIn(methodTest, "{ $expression; }", message);
@@ -1137,10 +1136,10 @@ class Test<S extends T, T extends Foo> {
LibraryElement library = mockLibrary(compiler, script);
compiler.parseScript(script, library);
- ClassElement classTest = library.find(const SourceString("Test"));
+ ClassElement classTest = library.find("Test");
classTest.ensureResolved(compiler);
FunctionElement methodTest =
- classTest.lookupLocalMember(const SourceString("test"));
+ classTest.lookupLocalMember("test");
ngeoffray 2013/10/18 10:19:37 One line.
lukas 2013/10/24 16:48:36 Done.
test(String expression, [message]) {
analyzeIn(methodTest, "{ $expression; }", message);
@@ -1161,10 +1160,10 @@ class Test<S extends T, T extends S> {
LibraryElement library = mockLibrary(compiler, script);
compiler.parseScript(script, library);
- ClassElement classTest = library.find(const SourceString("Test"));
+ ClassElement classTest = library.find("Test");
classTest.ensureResolved(compiler);
FunctionElement methodTest =
- classTest.lookupLocalMember(const SourceString("test"));
+ classTest.lookupLocalMember("test");
ngeoffray 2013/10/18 10:19:37 One line.
lukas 2013/10/24 16:48:36 Done.
test(String expression, [message]) {
analyzeIn(methodTest, "{ $expression; }", message);
@@ -1809,7 +1808,7 @@ analyze(String text, {errors, warnings, List hints, List infos}) {
Element compilationUnit =
new CompilationUnitElementX(new Script(null, null), compiler.mainApp);
Element function = new ElementX(
- buildSourceString(''), ElementKind.FUNCTION, compilationUnit);
+ '', ElementKind.FUNCTION, compilationUnit);
TreeElements elements = compiler.resolveNodeStatement(node, function);
TypeCheckerVisitor checker = new TypeCheckerVisitor(compiler, elements,
types);
@@ -1827,8 +1826,8 @@ void generateOutput(String text) {
var beginToken = message.node.getBeginToken();
var endToken = message.node.getEndToken();
int begin = beginToken.charOffset;
- int end = endToken.charOffset + endToken.slowCharCount;
- SourceFile sourceFile = new SourceFile('analysis', text);
+ int end = endToken.charOffset + endToken.charCount;
+ SourceFile sourceFile = new StringSourceFile('analysis', text);
print(sourceFile.getLocationMessage(message.message.toString(),
begin, end, true, (str) => str));
}

Powered by Google App Engine
This is Rietveld 408576698