1
// Copyright 2009 the Sputnik authors. All rights reserved.
2
// This code is governed by the BSD license found in the LICENSE file.
5
* If multi line comments csn not nest, they can contain any Unicode character
7
* @path ch07/7.4/S7.4_A6.js
8
* @description "var"+ yy+ "xx = 1", insert instead of yy all Unicode characters
14
for (var indexI = 0; indexI <= 65535; indexI++) {
17
eval("/*var " + String.fromCharCode(indexI) + "xx = 1*/");
18
var hex = decimalToHexString(indexI);
20
$ERROR('#' + hex + ' ');
24
$ERROR('#' + hex + ' ');
31
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count);
34
function decimalToHexString(n) {
37
for (var i = 3; i >= 0; i--) {
38
if (n >= Math.pow(16, i)) {
39
var t = Math.floor(n / Math.pow(16, i));
40
n -= t * Math.pow(16, i);
42
if ( t == 10 ) { h += "A"; }
43
if ( t == 11 ) { h += "B"; }
44
if ( t == 12 ) { h += "C"; }
45
if ( t == 13 ) { h += "D"; }
46
if ( t == 14 ) { h += "E"; }
47
if ( t == 15 ) { h += "F"; }