summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/decodeURIComponent/S15.1.3.2_A2.1_T1.js
blob: 203a206bdc6425be9d14a7816c38f7bdb116b362 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: If string.charAt(k) not equal "%", return this char
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests
includes: [decimalToHexString.js]
---*/

for (var indexI = 0; indexI <= 65535; indexI++) {
  if (indexI !== 0x25) {
    try {
      var str = String.fromCharCode(indexI);
      var differs = decodeURIComponent(str) !== str;
    } catch (e) {
      throw new Test262Error('#' + decimalToHexString(indexI) + ' throws');
    }
    if (differs) {
      throw new Test262Error('#' + decimalToHexString(indexI) + ' differs');
    }
  }
}

reportCompare(0, 0);