tor-browser

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

default-constructor-spread-override.js (594B)


      1 // Copyright (C) 2016 André Bargull. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-runtime-semantics-classdefinitionevaluation
      6 description: >
      7  Default class constructor does not use argument evaluation.
      8 features: [Symbol.iterator]
      9 ---*/
     10 
     11 Array.prototype[Symbol.iterator] = function() {
     12  throw new Test262Error('@@iterator invoked');
     13 };
     14 
     15 class Base {
     16  constructor(value) {
     17    this.value = value;
     18  }
     19 }
     20 
     21 class Derived extends Base {}
     22 
     23 const instance = new Derived(5);
     24 
     25 assert.sameValue(instance.value, 5);
     26 
     27 reportCompare(0, 0);