| 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 |
If B = 110xxxxx (n = 2) and string.charAt(k + 4) and |
| 7 |
string.charAt(k + 5) do not represent hexadecimal digits, throw URIError |
| 8 |
es5id: 15.1.3.1_A1.10_T1 |
| 9 |
es6id: 18.2.6.2 |
| 10 |
esid: sec-decodeuri-encodeduri |
| 11 |
description: Complex tests |
| 12 |
---*/ |
| 13 |
|
| 14 |
//CHECK |
| 15 |
var result = true; |
| 16 |
var interval = [ |
| 17 |
[0x00, 0x29], |
| 18 |
[0x40, 0x40], |
| 19 |
[0x47, 0x60], |
| 20 |
[0x67, 0xFFFF] |
| 21 |
]; |
| 22 |
for (var indexI = 0; indexI < interval.length; indexI++) { |
| 23 |
for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) { |
| 24 |
try { |
| 25 |
decodeURI("%C0%" + String.fromCharCode(indexJ, indexJ)); |
| 26 |
result = false; |
| 27 |
} catch (e) { |
| 28 |
if ((e instanceof URIError) !== true) { |
| 29 |
result = false; |
| 30 |
} |
| 31 |
} |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
if (result !== true) { |
| 36 |
$ERROR('#1: If B = 110xxxxx (n = 2) and (string.charAt(k + 4) and string.charAt(k + 5)) do not represent hexadecimal digits, throw URIError'); |
| 37 |
} |