diff options
author | Mike Pennisi <mike@mikepennisi.com> | 2016-05-10 11:57:37 -0400 |
---|---|---|
committer | Mike Pennisi <mike@mikepennisi.com> | 2016-05-10 11:57:37 -0400 |
commit | d4b263ccbb01429beef2c516a1fb2ea6ed56cf5a (patch) | |
tree | 8d15700b3c296bb438977ce08ef8a237b95a6088 /test/language/statements/let/dstr-ary-ptrn-elem-id-init-throws.js | |
parent | cc7381d3b22fab3c5c4f6eff1ece7207ba1dca33 (diff) | |
download | qtdeclarative-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.js | 33 |
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]; +}); |