tor-browser

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

line-terminators.js (1378B)


      1 // Copyright 2009 the Sputnik authors.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 info: |
      6    Since LineTerminator between "continue" and Identifier is not allowed,
      7    "continue" is evaluated without label
      8 es5id: 12.7_A2
      9 description: >
     10    Checking by using eval, inserting LineTerminator between continue
     11    and Identifier
     12 ---*/
     13 
     14 FOR1 : for(var i=1;i<2;i++){
     15  FOR1NESTED : for(var j=1;j<2;j++) {
     16    continue
     17 FOR1;
     18  } while(0);
     19 }
     20 
     21 assert.sameValue(j, 2, '#1: Since LineTerminator(U-000A) between continue and Identifier not allowed continue evaluates without label');
     22 
     23 FOR2 : for(var i=1;i<2;i++){
     24  FOR2NESTED : for(var j=1;j<2;j++) {
     25    continueFOR2;
     26  } while(0);
     27 }
     28 
     29 assert.sameValue(j, 2, '#2: Since LineTerminator(U-000D) between continue and Identifier not allowed continue evaluates without label');
     30 
     31 FOR3 : for(var i=1;i<2;i++){
     32  FOR3NESTED : for(var j=1;j<2;j++) {
     33    continueFOR3;
     34  } while(0);
     35 }
     36 assert.sameValue(j, 2, '#3: Since LineTerminator(U-2028) between continue and Identifier not allowed continue evaluates without label');
     37 
     38 FOR4 : for(var i=1;i<2;i++){
     39  FOR4NESTED : for(var j=1;j<2;j++) {
     40    continueFOR4;
     41  } while(0);
     42 }
     43 
     44 assert.sameValue(j, 2, '#4: Since LineTerminator(U-2029) between continue and Identifier not allowed continue evaluates without label');
     45 
     46 reportCompare(0, 0);