tor-browser

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

generator-params.js (611B)


      1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 description: >
      6    Generator functions declared as methods honor their declared formal
      7    parameters.
      8 es6id: 14.4.13
      9 features: [generators]
     10 ---*/
     11 
     12 var value1 = {};
     13 var value2 = {};
     14 var value3 = {};
     15 var arg1, arg2, arg3;
     16 var obj = {
     17  *method(a, b, c) {
     18    arg1 = a;
     19    arg2 = b;
     20    arg3 = c;
     21  }
     22 };
     23 
     24 obj.method(value1, value2, value3).next();
     25 
     26 assert.sameValue(arg1, value1);
     27 assert.sameValue(arg2, value2);
     28 assert.sameValue(arg3, value3);
     29 
     30 reportCompare(0, 0);