tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ary-ptrn-rest-id-elision-next-err.js (1254B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
      3 // - src/dstr-binding/error/try.template
      4 /*---
      5 description: Rest element following elision elements (try statement)
      6 esid: sec-runtime-semantics-catchclauseevaluation
      7 features: [generators, destructuring-binding]
      8 flags: [generated]
      9 info: |
     10    Catch : catch ( CatchParameter ) Block
     11 
     12    [...]
     13    5. Let status be the result of performing BindingInitialization for
     14       CatchParameter passing thrownValue and catchEnv as arguments.
     15    [...]
     16 
     17    13.3.3.6 Runtime Semantics: IteratorBindingInitialization
     18    ArrayBindingPattern : [ Elisionopt BindingRestElement ]
     19    1. If Elision is present, then
     20       a. Let status be the result of performing
     21          IteratorDestructuringAssignmentEvaluation of Elision with
     22          iteratorRecord as the argument.
     23       b. ReturnIfAbrupt(status).
     24    2. Return the result of performing IteratorBindingInitialization for
     25       BindingRestElement with iteratorRecord and environment as arguments.
     26 
     27 ---*/
     28 var iter = (function*() { throw new Test262Error(); })();
     29 
     30 assert.throws(Test262Error, function() {
     31  try {
     32    throw iter;
     33  } catch ([, ...x]) {}
     34 });
     35 
     36 reportCompare(0, 0);