tor-browser

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

ary-ptrn-elem-ary-elem-iter.js (1291B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
      3 // - src/dstr-binding/default/try.template
      4 /*---
      5 description: BindingElement with array binding pattern and initializer is not used (try statement)
      6 esid: sec-runtime-semantics-catchclauseevaluation
      7 features: [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 
     19    BindingElement : BindingPatternInitializer opt
     20 
     21    1. If iteratorRecord.[[done]] is false, then
     22       a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
     23       [...]
     24       e. Else,
     25          i. Let v be IteratorValue(next).
     26          [...]
     27    4. Return the result of performing BindingInitialization of BindingPattern
     28       with v and environment as the arguments.
     29 ---*/
     30 
     31 var ranCatch = false;
     32 
     33 try {
     34  throw [[7, 8, 9]];
     35 } catch ([[x, y, z] = [4, 5, 6]]) {
     36  assert.sameValue(x, 7);
     37  assert.sameValue(y, 8);
     38  assert.sameValue(z, 9);
     39  ranCatch = true;
     40 }
     41 
     42 assert(ranCatch, 'executed `catch` block');
     43 
     44 reportCompare(0, 0);