tor-browser

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

const-obj-ptrn-rest-skip-non-enumerable.js (1893B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
      3 // - src/dstr-binding/default/for-const.template
      4 /*---
      5 description: Rest object doesn't contain non-enumerable properties (for statement)
      6 esid: sec-for-statement-runtime-semantics-labelledevaluation
      7 features: [object-rest, destructuring-binding]
      8 flags: [generated]
      9 includes: [propertyHelper.js]
     10 info: |
     11    IterationStatement :
     12        for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
     13 
     14    [...]
     15    7. Let forDcl be the result of evaluating LexicalDeclaration.
     16    [...]
     17 
     18    LexicalDeclaration : LetOrConst BindingList ;
     19 
     20    1. Let next be the result of evaluating BindingList.
     21    2. ReturnIfAbrupt(next).
     22    3. Return NormalCompletion(empty).
     23 
     24    BindingList : BindingList , LexicalBinding
     25 
     26    1. Let next be the result of evaluating BindingList.
     27    2. ReturnIfAbrupt(next).
     28    3. Return the result of evaluating LexicalBinding.
     29 
     30    LexicalBinding : BindingPattern Initializer
     31 
     32    1. Let rhs be the result of evaluating Initializer.
     33    2. Let value be GetValue(rhs).
     34    3. ReturnIfAbrupt(value).
     35    4. Let env be the running execution context’s LexicalEnvironment.
     36    5. Return the result of performing BindingInitialization for BindingPattern
     37       using value and env as the arguments.
     38 ---*/
     39 var o = {a: 3, b: 4};
     40 Object.defineProperty(o, "x", { value: 4, enumerable: false });
     41 
     42 var iterCount = 0;
     43 
     44 for (const {...rest} = o; iterCount < 1; ) {
     45  assert.sameValue(rest.x, undefined);
     46 
     47  verifyProperty(rest, "a", {
     48    enumerable: true,
     49    writable: true,
     50    configurable: true,
     51    value: 3
     52  });
     53 
     54  verifyProperty(rest, "b", {
     55    enumerable: true,
     56    writable: true,
     57    configurable: true,
     58    value: 4
     59  });
     60 
     61  iterCount += 1;
     62 }
     63 
     64 assert.sameValue(iterCount, 1, 'Iteration occurred as expected');
     65 
     66 reportCompare(0, 0);