summaryrefslogtreecommitdiff
path: root/test/language/statements/let/dstr-ary-ptrn-elem-id-init-throws.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/let/dstr-ary-ptrn-elem-id-init-throws.js
parentcc7381d3b22fab3c5c4f6eff1ece7207ba1dca33 (diff)
downloadqtdeclarative-testsuites-d4b263ccbb01429beef2c516a1fb2ea6ed56cf5a.tar.gz
Generate tests
Diffstat (limited to 'test/language/statements/let/dstr-ary-ptrn-elem-id-init-throws.js')
-rw-r--r--test/language/statements/let/dstr-ary-ptrn-elem-id-init-throws.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/language/statements/let/dstr-ary-ptrn-elem-id-init-throws.js b/test/language/statements/let/dstr-ary-ptrn-elem-id-init-throws.js
new file mode 100644
index 000000000..f241f70f2
--- /dev/null
+++ b/test/language/statements/let/dstr-ary-ptrn-elem-id-init-throws.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
+// - src/dstr-binding/error/let-stmt.template
+/*---
+description: Destructuring initializer returns an abrupt completion (`let` 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
+
+ SingleNameBinding : BindingIdentifier Initializeropt
+
+ [...]
+ 6. If Initializer is present and v is undefined, then
+ a. Let defaultValue be the result of evaluating Initializer.
+ b. Let v be GetValue(defaultValue).
+ c. ReturnIfAbrupt(v).
+---*/
+
+assert.throws(Test262Error, function() {
+ let [x = (function() { throw new Test262Error(); })()] = [undefined];
+});