From c24a206511841e14f156b929005b9e5597c05965 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 20 May 2016 18:58:23 -0400 Subject: Re-format destructuring assignment tests Utilize the test generation tool to increase coverage of destructuring assignment semantics. Previously, only destructuring assignment in the AssignmentExpression position was tested. With this change applied, the same tests will assert expected behavior for destructuring assignment in `for..of` statements, as well. A limited number of tests are applied to the `for..in` statement as well, but due to the iteration protocol observed by that statement, many destructuring tests are not relevant, and others cannot be automatically generated from this format. --- .../array-rest-nested-array-invalid.case | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/dstr-assignment/array-rest-nested-array-invalid.case (limited to 'src/dstr-assignment/array-rest-nested-array-invalid.case') diff --git a/src/dstr-assignment/array-rest-nested-array-invalid.case b/src/dstr-assignment/array-rest-nested-array-invalid.case new file mode 100644 index 000000000..08eff54e2 --- /dev/null +++ b/src/dstr-assignment/array-rest-nested-array-invalid.case @@ -0,0 +1,18 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + It is a Syntax Error if LeftHandSideExpression is either an ObjectLiteral + or an ArrayLiteral and if the lexical token sequence matched by + LeftHandSideExpression cannot be parsed with no tokens left over using + AssignmentPattern as the goal symbol. +template: syntax +es6id: 12.14.5.1 +negative: SyntaxError +---*/ + +//- elems +[...[(x, y)]] +//- vals +[[]] -- cgit v1.2.1