tor-browser

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

yield-as-literal-property-name.js (518B)


      1 // Copyright (C) 2013 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    `yield` may be used as a literal property name in an object literal
      7    within generator function bodies.
      8 features: [generators]
      9 es6id: 12.1.1
     10 ---*/
     11 
     12 var result;
     13 var obj = {
     14  *g() {
     15    ({ get yield() { return 1 } });
     16  }
     17 };
     18 
     19 result = obj.g().next();
     20 assert.sameValue(result.value, undefined);
     21 assert.sameValue(result.done, true);
     22 
     23 reportCompare(0, 0);