Debian Codegraph @

js/src/tests/test262/built-ins/decodeURIComponent/S15.1.3.2_A2.1_T1.js

raw
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: If string.charAt(k) not equal "%", return this char
6 esid: sec-decodeuricomponent-encodeduricomponent
7 description: Complex tests
8 includes: [decimalToHexString.js]
9 ---*/
10
11 for (var indexI = 0; indexI <= 65535; indexI++) {
12 if (indexI !== 0x25) {
13 try {
14 var str = String.fromCharCode(indexI);
15 var differs = decodeURIComponent(str) !== str;
16 } catch (e) {
17 throw new Test262Error('#' + decimalToHexString(indexI) + ' throws');
18 }
19 if (differs) {
20 throw new Test262Error('#' + decimalToHexString(indexI) + ' differs');
21 }
22 }
23 }
24
25 reportCompare(0, 0);