Detect assignment pattern for for-in/of (#4140)

Furthermore do not allow default value for rest parameter

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2020-08-24 14:47:10 +02:00
committed by GitHub
parent 5b3f01af9d
commit 84bc1e03fb
10 changed files with 123 additions and 446 deletions
+3
View File
@@ -60,6 +60,9 @@ checkSyntax ("[()] = []");
checkSyntax ("try { let [$] = $;");
checkSyntax ("let a, [ b.c ] = [6];");
checkSyntax ("let [(a)] = [1]");
checkSyntax ("[...a = []] = [1]");
checkSyntax ("[...[a] = []] = [1]");
checkSyntax ("[...[a, [...b] = []] = []] = [1]");
mustThrow ("var [a] = 4");
mustThrow ("var [a] = 5");