tor-browser

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

generator-super-prop-param.js (493B)


      1 // Copyright 2015 Cubane Canada, Inc.  All rights reserved.
      2 // See LICENSE for details.
      3 
      4 /*---
      5 info: |
      6 GeneratorMethod can reference SuperProperty in default parameters
      7 es6id: 14.4.1
      8 author: Sam Mikes
      9 description: GeneratorMethod uses SuperProperty (allowed)
     10 features: [default-parameters, generators, super]
     11 ---*/
     12 
     13 var obj = {
     14  *foo(a = super.toString) {
     15    return a;
     16  }
     17 };
     18 
     19 obj.toString = null;
     20 
     21 assert.sameValue(obj.foo().next().value, Object.prototype.toString);
     22 
     23 reportCompare(0, 0);