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

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

Issue 10826279: Register toString dynamic invocation in the presence of string interpolation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/concrete_type_inference_test.dart ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/resolver_test.dart
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
index b0662000db0526546b0a99fbeed6b94798368d39..8de20aa63d6c0ea4ad0a8bd9479f5e0af020b3c6 100644
--- a/tests/compiler/dart2js/resolver_test.dart
+++ b/tests/compiler/dart2js/resolver_test.dart
@@ -2,10 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+#import('dart:uri');
+
#import("../../../lib/compiler/implementation/leg.dart");
#import("../../../lib/compiler/implementation/elements/elements.dart");
#import("../../../lib/compiler/implementation/tree/tree.dart");
#import("../../../lib/compiler/implementation/util/util.dart");
+#import("compiler_helper.dart");
#import("mock_compiler.dart");
#import("parser_helper.dart");
@@ -69,6 +72,7 @@ main() {
testThis();
testSuperCalls();
testTypeVariables();
+ testToString();
}
testTypeVariables() {
@@ -721,3 +725,18 @@ List<String> asSortedStrings(Link link) {
result.sort((s1, s2) => s1.compareTo(s2));
return result;
}
+
+testToString() {
+ Uri uri = new Uri.fromComponents(scheme: 'source');
+ MockCompiler compiler = compilerFor(
+ @"class C { toString() => 'C'; } main() { '${new C()}'; }",
+ uri);
+ compiler.runCompiler(uri);
+
+ Element toStringMethod = findElement(compiler, 'C')
+ .lookupLocalMember(buildSourceString('toString'));
+ Expect.isNotNull(toStringMethod);
+
+ Expect.isNotNull(
+ compiler.enqueuer.resolution.getCachedElements(toStringMethod));
+}
« no previous file with comments | « tests/compiler/dart2js/concrete_type_inference_test.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698