tor-browser

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

S7.4_A5.js (1274B)


      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    Single line comments can contain any Unicode character without Line
      7    Terminators
      8 es5id: 7.4_A5
      9 description: >
     10    //var " + xx + "yy = -1", insert instead of xx all Unicode
     11    characters
     12 ---*/
     13 
     14 var hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
     15 for (var i1 = 0; i1 < 16; i1++) {
     16  for (var i2 = 0; i2 < 16; i2++) {
     17    for (var i3 = 0; i3 < 16; i3++) {
     18      for (var i4 = 0; i4 < 16; i4++) {
     19        try {
     20          var uu = hex[i1] + hex[i2] + hex[i3] + hex[i4];
     21          var xx = String.fromCharCode("0x" + uu);
     22          var LineTerminators = ((uu === "000A") || (uu === "000D") || (uu === "2028") || (uu === "2029"));
     23          var yy = 0;
     24          eval("//var " + xx + "yy = -1");
     25          if (LineTerminators !== true) {
     26            if (yy !== 0) {
     27              throw new Test262Error('#' + uu + ' ');
     28            }
     29          } else {
     30            if (yy !== -1) {
     31              throw new Test262Error('#' + uu + ' ');
     32            }
     33          }
     34        } catch (e){
     35          throw new Test262Error('#' + uu + ' ');
     36        }
     37      }
     38    }
     39  }
     40 }
     41 
     42 reportCompare(0, 0);