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

Unified Diff: editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java

Issue 23461019: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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: editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java
diff --git a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java
index a045002e998875a3ce119d0bbdc97b4eb12d1401..657961143a8ad4d8dcc2b46714d5d5f8052b101b 100644
--- a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java
+++ b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SemanticTest.java
@@ -282,6 +282,96 @@ public class SemanticTest extends AbstractSemanticTest {
getFormattedSource(unit));
}
+ // XXX
Brian Wilkerson 2013/09/03 21:11:06 Do you still need this marker?
+ public void test_classInner_enclosingSuperClass() throws Exception {
+ setFileLines(
+ "test/S.java",
+ toString(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "public class S {",
+ " void outerMethod() {}",
+ "}"));
+ setFileLines(
+ "test/A.java",
+ toString(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "public class A extends S {",
+ " public class B {",
+ " public B() {}",
+ " void test() {",
+ " outerMethod();",
+ " }",
+ " }",
+ " B test2() {",
+ " return new B();",
+ " }",
+ "}"));
+ Context context = new Context();
+ context.addSourceFolder(tmpFolder);
+ context.addSourceFiles(tmpFolder);
+ // do translate
+ CompilationUnit unit = context.translate();
+ assertEquals(
+ toString(
+ "class A extends S {",
+ " A_B test2() => new A_B(this);",
+ "}",
+ "class A_B {",
+ " final A A_this;",
+ " A_B(this.A_this);",
+ " void test() {",
+ " A_this.outerMethod();",
+ " }",
+ "}",
+ "class S {",
+ " void outerMethod() {",
+ " }",
+ "}"),
+ getFormattedSource(unit));
+ }
+
+ public void test_classInner_enclosingThisQualifier() throws Exception {
+ setFileLines(
+ "test/A.java",
+ toString(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "public class A {",
+ " public class B {",
+ " void test() {",
+ " A.this.outerField = 5;",
+ " A.this.outerMethod();",
+ " }",
+ " }",
+ " int outerField;",
+ " void outerMethod() {}",
+ " B test2() {",
+ " return new B();",
+ " }",
+ "}"));
+ Context context = new Context();
+ context.addSourceFolder(tmpFolder);
+ context.addSourceFiles(tmpFolder);
+ // do translate
+ CompilationUnit unit = context.translate();
+ assertEquals(
+ toString(
+ "class A {",
+ " int outerField = 0;",
+ " void outerMethod() {",
+ " }",
+ " A_B test2() => new A_B(this);",
+ "}",
+ "class A_B {",
+ " final A A_this;",
+ " A_B(this.A_this);",
+ " void test() {",
+ " A_this.outerField = 5;",
+ " A_this.outerMethod();",
+ " }",
+ "}"),
+ getFormattedSource(unit));
+ }
+
public void test_classInner_referenceFromAnonymous() throws Exception {
setFileLines(
"test/A.java",

Powered by Google App Engine
This is Rietveld 408576698