tor-browser

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

ary-ptrn-empty.js (965B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/dstr-binding/ary-ptrn-empty.case
      3 // - src/dstr-binding/default/try.template
      4 /*---
      5 description: No iteration occurs for an "empty" array binding pattern (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 
     19    ArrayBindingPattern : [ ]
     20 
     21    1. Return NormalCompletion(empty).
     22 
     23 ---*/
     24 var iterations = 0;
     25 var iter = function*() {
     26  iterations += 1;
     27 }();
     28 
     29 var ranCatch = false;
     30 
     31 try {
     32  throw iter;
     33 } catch ([]) {
     34  assert.sameValue(iterations, 0);
     35  ranCatch = true;
     36 }
     37 
     38 assert(ranCatch, 'executed `catch` block');
     39 
     40 reportCompare(0, 0);