Skip to content

Commit b7c83d2

Browse files
committed
added 2 test for TypeInfoValidator.isArrayLookup (now with EXPERIMENTAL
flag disabled) dynamic array access is a choice of the users, if they do that then what comes afterwards should always be allowed
1 parent b240c4a commit b7c83d2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/org.eclipse.dltk.javascript.core.tests/src/org/eclipse/dltk/javascript/core/tests/validation/TypeInfoValidationTests.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2557,4 +2557,22 @@ public void testThisAnnotationValid() {
25572557
final List<IProblem> problems = validate(code.toString());
25582558
assertEquals(problems.toString(), 0, problems.size());
25592559
}
2560+
2561+
public void testJavaScriptDynamicArrayAcces() {
2562+
final StringList code = new StringList();
2563+
code.add("var x = new Array();");
2564+
code.add("x['test']();");
2565+
code.add("var y = {}");
2566+
code.add("y['test']();");
2567+
final List<IProblem> problems = validate(code.toString());
2568+
assertEquals(problems.toString(), 0, problems.size());
2569+
}
2570+
2571+
public void testJavaObjectDynamicArrayAcces() {
2572+
final StringList code = new StringList();
2573+
code.add("exampleForms['test']();");
2574+
final List<IProblem> problems = validate(code.toString());
2575+
assertEquals(problems.toString(), 0, problems.size());
2576+
}
2577+
25602578
}

0 commit comments

Comments
 (0)