summaryrefslogtreecommitdiff
path: root/src/dstr-assignment/array-rest-nested-array-undefined-own.case
diff options
context:
space:
mode:
authorMike Pennisi <mike@mikepennisi.com>2016-05-20 18:58:23 -0400
committerMike Pennisi <mike@mikepennisi.com>2016-05-25 13:47:06 -0400
commitc24a206511841e14f156b929005b9e5597c05965 (patch)
tree64f62d6936fe2f18158ee6fc3bccfe8bb77bc656 /src/dstr-assignment/array-rest-nested-array-undefined-own.case
parent56b988883e3e1819cdc98b21c125be4c80f2bc24 (diff)
downloadqtdeclarative-testsuites-c24a206511841e14f156b929005b9e5597c05965.tar.gz
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.
Diffstat (limited to 'src/dstr-assignment/array-rest-nested-array-undefined-own.case')
-rw-r--r--src/dstr-assignment/array-rest-nested-array-undefined-own.case20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/dstr-assignment/array-rest-nested-array-undefined-own.case b/src/dstr-assignment/array-rest-nested-array-undefined-own.case
new file mode 100644
index 000000000..5da0f9982
--- /dev/null
+++ b/src/dstr-assignment/array-rest-nested-array-undefined-own.case
@@ -0,0 +1,20 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+desc: >
+ When DestructuringAssignmentTarget is an array literal and the iterable
+ emits `undefined` as the only value, an array with a single `undefined`
+ element should be used as the value of the nested DestructuringAssignment.
+template: default
+es6id: 12.14.5.3
+---*/
+
+//- setup
+var x = null;
+//- elems
+[...[x]]
+//- vals
+[undefined]
+//- body
+assert.sameValue(x, undefined);