Skip to content

Commit 7577cc4

Browse files
asgerfCopilot
andcommitted
JS: Use text block in robustness test
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 18d3b29 commit 7577cc4

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

‎javascript/extractor/test/com/semmle/js/extractor/test/RobustnessTests.java‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ public void letLookheadTest() {
2323
@Test
2424
public void permissiveDestructuringTest() {
2525
String src =
26-
"({ shorthand = 1 });\n"
27-
+ "([...rest,] = values);\n"
28-
+ "function f(...args,) {}\n"
29-
+ "function g(...[first, { nested }],) {}\n"
30-
+ "const arrow = (...args,) => args;\n"
31-
+ "const destructuringArrow = (...{ value },) => value;\n"
32-
+ "async (...[first, { nested }],) => first;\n"
33-
+ "({ method(...{ value },) {} });\n";
26+
"""
27+
({ shorthand = 1 });
28+
([...rest,] = values);
29+
function f(...args,) {}
30+
function g(...[first, { nested }],) {}
31+
const arrow = (...args,) => args;
32+
const destructuringArrow = (...{ value },) => value;
33+
async (...[first, { nested }],) => first;
34+
({ method(...{ value },) {} });
35+
""";
3436
new Parser(new Options(), src, 0).parse();
3537
}
3638

0 commit comments

Comments
 (0)