summaryrefslogtreecommitdiff
path: root/test/language/statements/const/dstr-ary-ptrn-rest-obj-id.js
diff options
context:
space:
mode:
authorMike Pennisi <mike@mikepennisi.com>2016-05-10 11:57:37 -0400
committerMike Pennisi <mike@mikepennisi.com>2016-05-10 11:57:37 -0400
commitd4b263ccbb01429beef2c516a1fb2ea6ed56cf5a (patch)
tree8d15700b3c296bb438977ce08ef8a237b95a6088 /test/language/statements/const/dstr-ary-ptrn-rest-obj-id.js
parentcc7381d3b22fab3c5c4f6eff1ece7207ba1dca33 (diff)
downloadqtdeclarative-testsuites-d4b263ccbb01429beef2c516a1fb2ea6ed56cf5a.tar.gz
Generate tests
Diffstat (limited to 'test/language/statements/const/dstr-ary-ptrn-rest-obj-id.js')
-rw-r--r--test/language/statements/const/dstr-ary-ptrn-rest-obj-id.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/language/statements/const/dstr-ary-ptrn-rest-obj-id.js b/test/language/statements/const/dstr-ary-ptrn-rest-obj-id.js
new file mode 100644
index 000000000..c4b40e3e4
--- /dev/null
+++ b/test/language/statements/const/dstr-ary-ptrn-rest-obj-id.js
@@ -0,0 +1,36 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-rest-obj-id.case
+// - src/dstr-binding/default/const-stmt.template
+/*---
+description: Rest element containing an object binding pattern (`const` statement)
+esid: sec-let-and-const-declarations-runtime-semantics-evaluation
+es6id: 13.3.1.4
+features: [destructuring-binding]
+flags: [generated]
+info: |
+ LexicalBinding : BindingPattern Initializer
+
+ 1. Let rhs be the result of evaluating Initializer.
+ 2. Let value be GetValue(rhs).
+ 3. ReturnIfAbrupt(value).
+ 4. Let env be the running execution context's LexicalEnvironment.
+ 5. Return the result of performing BindingInitialization for BindingPattern
+ using value and env as the arguments.
+
+ 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
+
+ BindingRestElement : ... BindingPattern
+
+ 1. Let A be ArrayCreate(0).
+ [...]
+ 3. Repeat
+ [...]
+ b. If iteratorRecord.[[done]] is true, then
+ i. Return the result of performing BindingInitialization of
+ BindingPattern with A and environment as the arguments.
+ [...]
+---*/
+
+const [...{ length }] = [1, 2, 3];
+
+assert.sameValue(length, 3);