tor-browser

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

yield-newline.js (660B)


      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    Newlines terminate `yield` expressions.
      7 features: [generators]
      8 es6id: 14.4
      9 ---*/
     10 
     11 var iter, result;
     12 var obj = {
     13  *g() {
     14    yield
     15    1
     16  }
     17 };
     18 
     19 iter = obj.g();
     20 
     21 result = iter.next();
     22 assert.sameValue(result.value, undefined, 'First result `value`');
     23 assert.sameValue(result.done, false, 'First result `done` flag');
     24 
     25 result = iter.next();
     26 assert.sameValue(result.value, undefined, 'Second result `value`');
     27 assert.sameValue(result.done, true, 'Second result `done` flag');
     28 
     29 reportCompare(0, 0);