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

23 lines
669 B
JavaScript
Raw Normal View History

// 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
2017-06-29 21:42:01 +02:00
esid: sec-decodeuricomponent-encodeduricomponent
description: Complex tests
includes: [decimalToHexString.js]
---*/
for (var indexI = 0; indexI <= 65535; indexI++) {
if (indexI !== 0x25) {
2017-06-29 21:42:11 +02:00
try {
var str = String.fromCharCode(indexI);
2017-06-29 21:42:11 +02:00
if (decodeURIComponent(str) !== str) {
throw new Test262Error('#' + decimalToHexString(indexI) + ' ');
2017-06-29 21:42:11 +02:00
}
} catch (e) {
throw new Test262Error('#' + decimalToHexString(indexI) + ' ');
2017-06-29 21:42:11 +02:00
}
}
2017-06-29 21:42:11 +02:00
}