| 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 b11dfc5f1e6ef651b69dc8234ce28c07d20afb0b..4668a2149234bff94a45be46a1a9c9d7d1777b40 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
|
| @@ -206,12 +206,14 @@ public class SemanticTest extends AbstractSemanticTest {
|
| "package test;",
|
| "public class Test {",
|
| " boolean hasErrors;",
|
| + " static boolean staticField;",
|
| " public void foo() {};",
|
| " public void main() {",
|
| " ErrorListener v = new ErrorListener() {",
|
| " public void onError() {",
|
| " foo();",
|
| " hasErrors = true;",
|
| + " staticField = true;",
|
| " }",
|
| " };",
|
| " }",
|
| @@ -226,6 +228,7 @@ public class SemanticTest extends AbstractSemanticTest {
|
| "}",
|
| "class Test {",
|
| " bool _hasErrors = false;",
|
| + " static bool _staticField = false;",
|
| " void foo() {",
|
| " }",
|
| " void main() {",
|
| @@ -238,6 +241,7 @@ public class SemanticTest extends AbstractSemanticTest {
|
| " void onError() {",
|
| " Test_this.foo();",
|
| " Test_this._hasErrors = true;",
|
| + " Test._staticField = true;",
|
| " }",
|
| "}"),
|
| getFormattedSource(unit));
|
| @@ -411,6 +415,37 @@ public class SemanticTest extends AbstractSemanticTest {
|
| getFormattedSource(unit));
|
| }
|
|
|
| + public void test_classInner_referenceEnclosingClassField_array() throws Exception {
|
| + setFileLines(
|
| + "test/A.java",
|
| + toString(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "public class A {",
|
| + " public class B {",
|
| + " public int test() {",
|
| + " return values.length;",
|
| + " }",
|
| + " }",
|
| + " int[] values;",
|
| + "}"));
|
| + context.addSourceFolder(tmpFolder);
|
| + context.addSourceFiles(tmpFolder);
|
| + // do translate
|
| + translate();
|
| + printFormattedSource(unit);
|
| + assertEquals(
|
| + toString(
|
| + "class A {",
|
| + " List<int> _values;",
|
| + "}",
|
| + "class A_B {",
|
| + " final A A_this;",
|
| + " A_B(this.A_this);",
|
| + " int test() => A_this._values.length;",
|
| + "}"),
|
| + getFormattedSource(unit));
|
| + }
|
| +
|
| public void test_classInner_referenceFromAnonymous() throws Exception {
|
| setFileLines(
|
| "test/A.java",
|
|
|