tor-browser

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

call-spread-obj-skip-non-enumerable.js (1085B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/spread/obj-skip-non-enumerable.case
      3 // - src/spread/default/super-call.template
      4 /*---
      5 description: Object Spread doesn't copy non-enumerable properties (SuperCall)
      6 esid: sec-super-keyword-runtime-semantics-evaluation
      7 features: [object-spread]
      8 flags: [generated]
      9 info: |
     10    SuperCall : super Arguments
     11 
     12    1. Let newTarget be GetNewTarget().
     13    2. If newTarget is undefined, throw a ReferenceError exception.
     14    3. Let func be GetSuperConstructor().
     15    4. ReturnIfAbrupt(func).
     16    5. Let argList be ArgumentListEvaluation of Arguments.
     17    [...]
     18 ---*/
     19 
     20 let o = {};
     21 Object.defineProperty(o, "b", {value: 3, enumerable: false});
     22 
     23 
     24 var callCount = 0;
     25 
     26 class Test262ParentClass {
     27  constructor(obj) {
     28    assert.sameValue(obj.hasOwnProperty("b"), false)
     29    assert.sameValue(Object.keys(obj).length, 0);
     30    callCount += 1;
     31  }
     32 }
     33 
     34 class Test262ChildClass extends Test262ParentClass {
     35  constructor() {
     36    super({...o});
     37  }
     38 }
     39 
     40 new Test262ChildClass();
     41 assert.sameValue(callCount, 1);
     42 
     43 reportCompare(0, 0);