tor-browser

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

cptn-abrupt-empty.js (829B)


      1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 es6id: 13.7.2.6
      5 description: >
      6    Completion value when iteration completes due to an empty abrupt completion
      7 info: |
      8    IterationStatement : do Statement while ( Expression ) ;
      9 
     10    1. Let V = undefined.
     11    2. Repeat
     12       a. Let stmt be the result of evaluating Statement.
     13       b. If LoopContinues(stmt, labelSet) is false, return
     14          Completion(UpdateEmpty(stmt, V)).
     15 ---*/
     16 
     17 assert.sameValue(eval('1; do { break; } while (false)'), undefined);
     18 assert.sameValue(eval('2; do { 3; break; } while (false)'), 3);
     19 
     20 assert.sameValue(eval('4; do { continue; } while (false)'), undefined);
     21 assert.sameValue(eval('5; do { 6; continue; } while (false)'), 6);
     22 
     23 reportCompare(0, 0);