summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/decodeURI
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /js/src/tests/test262/built-ins/decodeURI
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/built-ins/decodeURI')
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.10_T1.js37
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.11_T1.js40
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.11_T2.js40
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.12_T1.js41
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.12_T2.js41
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.12_T3.js41
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.13_T1.js65
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.13_T2.js65
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T1.js65
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T2.js65
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T3.js65
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T4.js65
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T1.js65
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T2.js65
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T3.js65
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T4.js65
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T5.js65
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T6.js65
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.1_T1.js56
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.2_T1.js37
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.2_T2.js37
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.3_T1.js56
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.3_T2.js56
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.4_T1.js64
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.5_T1.js64
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.6_T1.js64
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.7_T1.js58
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.8_T1.js59
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.8_T2.js59
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.9_T1.js59
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.9_T2.js59
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.9_T3.js59
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.1_T1.js25
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.2_T1.js60
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.3_T1.js59
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.4_T1.js65
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.5_T1.js70
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A3_T1.js67
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A3_T2.js67
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A3_T3.js22
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T1.js25
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T2.js25
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T3.js30
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T4.js30
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.1.js27
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.2.js27
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.3.js18
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.4.js15
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.5.js27
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.6.js15
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.7.js23
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A6_T1.js129
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/browser.js0
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/name.js28
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/not-a-constructor.js31
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/prop-desc.js19
-rw-r--r--js/src/tests/test262/built-ins/decodeURI/shell.js52
57 files changed, 2763 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.10_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.10_T1.js
new file mode 100644
index 0000000000..b9169dad31
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.10_T1.js
@@ -0,0 +1,37 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 110xxxxx (n = 2) and string.charAt(k + 4) and
+ string.charAt(k + 5) do not represent hexadecimal digits, throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests
+---*/
+
+//CHECK
+var result = true;
+var interval = [
+ [0x00, 0x2F],
+ [0x3A, 0x40],
+ [0x47, 0x60],
+ [0x67, 0xFFFF]
+];
+for (var indexI = 0; indexI < interval.length; indexI++) {
+ for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
+ try {
+ decodeURI("%C0%" + String.fromCharCode(indexJ, indexJ));
+ result = false;
+ } catch (e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+ }
+ }
+}
+
+if (result !== true) {
+ throw new Test262Error('#1: If B = 110xxxxx (n = 2) and (string.charAt(k + 4) and string.charAt(k + 5)) do not represent hexadecimal digits, throw URIError');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.11_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.11_T1.js
new file mode 100644
index 0000000000..9825ea63bd
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.11_T1.js
@@ -0,0 +1,40 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 1110xxxx (n = 3) and (string.charAt(k + 4) and
+ string.charAt(k + 5)) or (string.charAt(k + 7) and
+ string.charAt(k + 8)) do not represent hexadecimal digits, throw URIError
+esid: sec-decodeuri-encodeduri
+description: >
+ Complex tests, string.charAt(k + 4) and string.charAt(k + 5) do
+ not represent hexadecimal digits
+---*/
+
+//CHECK
+var result = true;
+var interval = [
+ [0x00, 0x2F],
+ [0x3A, 0x40],
+ [0x47, 0x60],
+ [0x67, 0xFFFF]
+];
+for (var indexI = 0; indexI < interval.length; indexI++) {
+ for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
+ try {
+ decodeURI("%E0%" + String.fromCharCode(indexJ, indexJ) + "%A0");
+ result = false;
+ } catch (e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+ }
+ }
+}
+
+if (result !== true) {
+ throw new Test262Error('#1: If B = 1110xxxx (n = 3) and (string.charAt(k + 4) and string.charAt(k + 5)) do not represent hexadecimal digits, throw URIError');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.11_T2.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.11_T2.js
new file mode 100644
index 0000000000..69dc138cbe
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.11_T2.js
@@ -0,0 +1,40 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 1110xxxx (n = 3) and (string.charAt(k + 4) and
+ string.charAt(k + 5)) or (string.charAt(k + 7) and
+ string.charAt(k + 8)) do not represent hexadecimal digits, throw URIError
+esid: sec-decodeuri-encodeduri
+description: >
+ Complex tests, string.charAt(k + 7) and string.charAt(k + 8) do
+ not represent hexadecimal digits
+---*/
+
+//CHECK
+var result = true;
+var interval = [
+ [0x00, 0x2F],
+ [0x3A, 0x40],
+ [0x47, 0x60],
+ [0x67, 0xFFFF]
+];
+for (var indexI = 0; indexI < interval.length; indexI++) {
+ for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
+ try {
+ decodeURI("%E0" + "%A0%" + String.fromCharCode(indexJ, indexJ));
+ result = false;
+ } catch (e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+ }
+ }
+}
+
+if (result !== true) {
+ throw new Test262Error('#1: If B = 1110xxxx (n = 3) and (string.charAt(k + 7) and string.charAt(k + 8)) do not represent hexadecimal digits, throw URIError');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.12_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.12_T1.js
new file mode 100644
index 0000000000..23b79b91b9
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.12_T1.js
@@ -0,0 +1,41 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 11110xxx (n = 4) and (string.charAt(k + 4) and
+ string.charAt(k + 5)) or (string.charAt(k + 7) and
+ string.charAt(k + 8)) or (string.charAt(k + 10) and
+ string.charAt(k + 11)) do not represent hexadecimal digits, throw URIError
+esid: sec-decodeuri-encodeduri
+description: >
+ Complex tests, string.charAt(k + 4) and string.charAt(k + 5) do
+ not represent hexadecimal digits
+---*/
+
+//CHECK
+var result = true;
+var interval = [
+ [0x00, 0x2F],
+ [0x3A, 0x40],
+ [0x47, 0x60],
+ [0x67, 0xFFFF]
+];
+for (var indexI = 0; indexI < interval.length; indexI++) {
+ for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
+ try {
+ decodeURI("%F0%" + String.fromCharCode(indexJ, indexJ) + "%A0%A0");
+ result = false;
+ } catch (e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+ }
+ }
+}
+
+if (result !== true) {
+ throw new Test262Error('#1: If B = 11110xxx (n = 4) and (string.charAt(k + 4) and string.charAt(k + 5)) do not represent hexadecimal digits, throw URIError');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.12_T2.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.12_T2.js
new file mode 100644
index 0000000000..5fe9906095
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.12_T2.js
@@ -0,0 +1,41 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 11110xxx (n = 4) and (string.charAt(k + 4) and
+ string.charAt(k + 5)) or (string.charAt(k + 7) and
+ string.charAt(k + 8)) or (string.charAt(k + 10) and
+ string.charAt(k + 11)) do not represent hexadecimal digits, throw URIError
+esid: sec-decodeuri-encodeduri
+description: >
+ Complex tests, string.charAt(k + 7) and string.charAt(k + 7) do
+ not represent hexadecimal digits
+---*/
+
+//CHECK
+var result = true;
+var interval = [
+ [0x00, 0x2F],
+ [0x3A, 0x40],
+ [0x47, 0x60],
+ [0x67, 0xFFFF]
+];
+for (var indexI = 0; indexI < interval.length; indexI++) {
+ for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
+ try {
+ decodeURI("%F0" + "%A0%" + String.fromCharCode(indexJ, indexJ) + "%A0");
+ result = false;
+ } catch (e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+ }
+ }
+}
+
+if (result !== true) {
+ throw new Test262Error('#1: If B = 11110xxx (n = 4) and (string.charAt(k + 7) and string.charAt(k + 8)) do not represent hexadecimal digits, throw URIError');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.12_T3.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.12_T3.js
new file mode 100644
index 0000000000..dd49d96367
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.12_T3.js
@@ -0,0 +1,41 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 11110xxx (n = 4) and (string.charAt(k + 4) and
+ string.charAt(k + 5)) or (string.charAt(k + 7) and
+ string.charAt(k + 8)) or (string.charAt(k + 10) and
+ string.charAt(k + 11)) do not represent hexadecimal digits, throw URIError
+esid: sec-decodeuri-encodeduri
+description: >
+ Complex tests, string.charAt(k + 10) and string.charAt(k + 11) do
+ not represent hexadecimal digits
+---*/
+
+//CHECK
+var result = true;
+var interval = [
+ [0x00, 0x2F],
+ [0x3A, 0x40],
+ [0x47, 0x60],
+ [0x67, 0xFFFF]
+];
+for (var indexI = 0; indexI < interval.length; indexI++) {
+ for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
+ try {
+ decodeURI("%F0" + "%A0%A0%" + String.fromCharCode(indexJ, indexJ));
+ result = false;
+ } catch (e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+ }
+ }
+}
+
+if (result !== true) {
+ throw new Test262Error('#1: If B = 11110xxx (n = 4) and (string.charAt(k + 10) and string.charAt(k + 11)) do not represent hexadecimal digits, throw URIError');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.13_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.13_T1.js
new file mode 100644
index 0000000000..bcb07b28f9
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.13_T1.js
@@ -0,0 +1,65 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 110xxxxx (n = 2) and C != 10xxxxxx (C - first of octets after B),
+ throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xC0 - 0xDF], C = [0x00, 0x7F]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB = 0xC0; indexB <= 0xDF; indexB++) {
+ count++;
+ var hexB = decimalToPercentHexString(indexB);
+ var result = true;
+ for (var indexC = 0x00; indexC <= 0x7F; indexC++) {
+ var hexC = decimalToPercentHexString(indexC);
+ try {
+ decodeURI(hexB + hexC);
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = indexB;
+ } else {
+ if ((indexB - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = indexB;
+ }
+ }
+ indexP = indexB;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.13_T2.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.13_T2.js
new file mode 100644
index 0000000000..a03e58e897
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.13_T2.js
@@ -0,0 +1,65 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 110xxxxx (n = 2) and C != 10xxxxxx (C - first of octets after B),
+ throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xC0 - 0xDF], C = [0xC0, 0xFF]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB = 0xC0; indexB <= 0xDF; indexB++) {
+ count++;
+ var hexB = decimalToPercentHexString(indexB);
+ var result = true;
+ for (var indexC = 0xC0; indexC <= 0xFF; indexC++) {
+ var hexC = decimalToPercentHexString(indexC);
+ try {
+ decodeURI(hexB + hexC);
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = indexB;
+ } else {
+ if ((indexB - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = indexB;
+ }
+ }
+ indexP = indexB;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T1.js
new file mode 100644
index 0000000000..818c495dea
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T1.js
@@ -0,0 +1,65 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 1110xxxx (n = 3) and C != 10xxxxxx (C - first of octets after B),
+ throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xE0 - 0xEF], C = [0x00, 0x7F]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB = 0xE0; indexB <= 0xEF; indexB++) {
+ count++;
+ var hexB = decimalToPercentHexString(indexB);
+ var result = true;
+ for (var indexC = 0x00; indexC <= 0x7F; indexC++) {
+ var hexC = decimalToPercentHexString(indexC);
+ try {
+ decodeURI(hexB + hexC + "%A0");
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = indexB;
+ } else {
+ if ((indexB - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = indexB;
+ }
+ }
+ indexP = indexB;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T2.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T2.js
new file mode 100644
index 0000000000..99bc74c842
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T2.js
@@ -0,0 +1,65 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 1110xxxx (n = 3) and C != 10xxxxxx (C - first of octets after B),
+ throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xE0 - 0xEF], C = [0x00, 0x7F]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB = 0xE0; indexB <= 0xEF; indexB++) {
+ count++;
+ var hexB = decimalToPercentHexString(indexB);
+ var result = true;
+ for (var indexC = 0x00; indexC <= 0x7F; indexC++) {
+ var hexC = decimalToPercentHexString(indexC);
+ try {
+ decodeURI(hexB + "%A0" + hexC);
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = indexB;
+ } else {
+ if ((indexB - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = indexB;
+ }
+ }
+ indexP = indexB;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T3.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T3.js
new file mode 100644
index 0000000000..66e644f4a3
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T3.js
@@ -0,0 +1,65 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 1110xxxx (n = 3) and C != 10xxxxxx (C - first of octets after B),
+ throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xE0 - 0xEF], C = [0xC0, 0xFF]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB = 0xE0; indexB <= 0xEF; indexB++) {
+ count++;
+ var hexB = decimalToPercentHexString(indexB);
+ var result = true;
+ for (var indexC = 0xC0; indexC <= 0xFF; indexC++) {
+ var hexC = decimalToPercentHexString(indexC);
+ try {
+ decodeURI(hexB + hexC + "%A0");
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = indexB;
+ } else {
+ if ((indexB - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = indexB;
+ }
+ }
+ indexP = indexB;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T4.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T4.js
new file mode 100644
index 0000000000..84bc45c084
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.14_T4.js
@@ -0,0 +1,65 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 1110xxxx (n = 3) and C != 10xxxxxx (C - first of octets after B),
+ throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xE0 - 0xEF], C = [0xC0, 0xFF]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB = 0xE0; indexB <= 0xEF; indexB++) {
+ count++;
+ var hexB = decimalToPercentHexString(indexB);
+ var result = true;
+ for (var indexC = 0xC0; indexC <= 0xFF; indexC++) {
+ var hexC = decimalToPercentHexString(indexC);
+ try {
+ decodeURI(hexB + "%A0" + hexC);
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = indexB;
+ } else {
+ if ((indexB - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = indexB;
+ }
+ }
+ indexP = indexB;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T1.js
new file mode 100644
index 0000000000..fc3fe4d53d
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T1.js
@@ -0,0 +1,65 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 11110xxx (n = 4) and C != 10xxxxxx (C - first of octets after B),
+ throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xF0 - 0x0F7], C = [0x00, 0x7F]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB = 0xF0; indexB <= 0xF7; indexB++) {
+ count++;
+ var hexB = decimalToPercentHexString(indexB);
+ var result = true;
+ for (var indexC = 0x00; indexC <= 0x7F; indexC++) {
+ var hexC = decimalToPercentHexString(indexC);
+ try {
+ decodeURI(hexB + hexC + "%A0%A0");
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = indexB;
+ } else {
+ if ((indexB - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = indexB;
+ }
+ }
+ indexP = indexB;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T2.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T2.js
new file mode 100644
index 0000000000..65a66ab893
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T2.js
@@ -0,0 +1,65 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 11110xxx (n = 4) and C != 10xxxxxx (C - first of octets after B),
+ throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xF0 - 0x0F7], C = [0x00, 0x7F]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB = 0xF0; indexB <= 0xF7; indexB++) {
+ count++;
+ var hexB = decimalToPercentHexString(indexB);
+ var result = true;
+ for (var indexC = 0x00; indexC <= 0x7F; indexC++) {
+ var hexC = decimalToPercentHexString(indexC);
+ try {
+ decodeURI(hexB + "%A0" + hexC + "%A0");
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = indexB;
+ } else {
+ if ((indexB - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = indexB;
+ }
+ }
+ indexP = indexB;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T3.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T3.js
new file mode 100644
index 0000000000..b3c7837966
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T3.js
@@ -0,0 +1,65 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 11110xxx (n = 4) and C != 10xxxxxx (C - first of octets after B),
+ throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xF0 - 0x0F7], C = [0x00, 0x7F]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB = 0xF0; indexB <= 0xF7; indexB++) {
+ count++;
+ var hexB = decimalToPercentHexString(indexB);
+ var result = true;
+ for (var indexC = 0x00; indexC <= 0x7F; indexC++) {
+ var hexC = decimalToPercentHexString(indexC);
+ try {
+ decodeURI(hexB + "%A0%A0" + hexC);
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = indexB;
+ } else {
+ if ((indexB - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = indexB;
+ }
+ }
+ indexP = indexB;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T4.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T4.js
new file mode 100644
index 0000000000..b9c8cd6ba9
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T4.js
@@ -0,0 +1,65 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 11110xxx (n = 4) and C != 10xxxxxx (C - first of octets after B),
+ throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xF0 - 0x0F7], C = [0xC0, 0xFF]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB = 0xF0; indexB <= 0xF7; indexB++) {
+ count++;
+ var hexB = decimalToPercentHexString(indexB);
+ var result = true;
+ for (var indexC = 0xC0; indexC <= 0xFF; indexC++) {
+ var hexC = decimalToPercentHexString(indexC);
+ try {
+ decodeURI(hexB + hexC + "%A0%A0");
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = indexB;
+ } else {
+ if ((indexB - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = indexB;
+ }
+ }
+ indexP = indexB;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T5.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T5.js
new file mode 100644
index 0000000000..86df8923b0
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T5.js
@@ -0,0 +1,65 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 11110xxx (n = 4) and C != 10xxxxxx (C - first of octets after B),
+ throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xF0 - 0x0F7], C = [0xC0, 0xFF]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB = 0xF0; indexB <= 0xF7; indexB++) {
+ count++;
+ var hexB = decimalToPercentHexString(indexB);
+ var result = true;
+ for (var indexC = 0xC0; indexC <= 0xFF; indexC++) {
+ var hexC = decimalToPercentHexString(indexC);
+ try {
+ decodeURI(hexB + "%A0" + hexC + "%A0");
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = indexB;
+ } else {
+ if ((indexB - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = indexB;
+ }
+ }
+ indexP = indexB;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T6.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T6.js
new file mode 100644
index 0000000000..641485f6d1
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.15_T6.js
@@ -0,0 +1,65 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 11110xxx (n = 4) and C != 10xxxxxx (C - first of octets after B),
+ throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xF0 - 0x0F7], C = [0xC0, 0xFF]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB = 0xF0; indexB <= 0xF7; indexB++) {
+ count++;
+ var hexB = decimalToPercentHexString(indexB);
+ var result = true;
+ for (var indexC = 0xC0; indexC <= 0xFF; indexC++) {
+ var hexC = decimalToPercentHexString(indexC);
+ try {
+ decodeURI(hexB + "%A0%A0" + hexC);
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = indexB;
+ } else {
+ if ((indexB - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = indexB;
+ }
+ }
+ indexP = indexB;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.1_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.1_T1.js
new file mode 100644
index 0000000000..096bc4fc7c
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.1_T1.js
@@ -0,0 +1,56 @@
+// 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) equal "%" and k + 2 >= string.length, throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests
+---*/
+
+var result = true;
+
+//CHECK#1
+try {
+ decodeURI("%");
+ result = false;
+} catch (e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+}
+
+//CHECK#2
+try {
+ decodeURI("%A");
+ result = false;
+} catch (e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+}
+
+//CHECK#3
+try {
+ decodeURI("%1");
+ result = false;
+} catch (e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+}
+
+//CHECK#4
+try {
+ decodeURI("% ");
+ result = false;
+} catch (e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+}
+
+if (result !== true) {
+ throw new Test262Error('#1: If string.charAt(k) equal "%" and k + 2 >= string.length, throw URIError');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.2_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.2_T1.js
new file mode 100644
index 0000000000..a58dd10eec
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.2_T1.js
@@ -0,0 +1,37 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = string.charAt(k+1) + string.charAt(k+2) do not represent
+ hexadecimal digits, throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests
+---*/
+
+//CHECK
+var result = true;
+var interval = [
+ [0x00, 0x2F],
+ [0x3A, 0x40],
+ [0x47, 0x60],
+ [0x67, 0xFFFF]
+];
+for (var indexI = 0; indexI < interval.length; indexI++) {
+ for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
+ try {
+ decodeURI("%" + String.fromCharCode(indexJ) + "1");
+ result = false;
+ } catch (e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+ }
+ }
+}
+
+if (result !== true) {
+ throw new Test262Error('#1: If string.charAt(k+1) does not represent hexadecimal digits, throw URIError');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.2_T2.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.2_T2.js
new file mode 100644
index 0000000000..73452d352e
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.2_T2.js
@@ -0,0 +1,37 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = string.charAt(k+1) + string.charAt(k+2) do not represent
+ hexadecimal digits, throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests
+---*/
+
+//CHECK
+var result = true;
+var interval = [
+ [0x00, 0x2F],
+ [0x3A, 0x40],
+ [0x47, 0x60],
+ [0x67, 0xFFFF]
+];
+for (var indexI = 0; indexI < interval.length; indexI++) {
+ for (var indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
+ try {
+ decodeURI("%" + "1" + String.fromCharCode(indexJ));
+ result = false;
+ } catch (e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+ }
+ }
+}
+
+if (result !== true) {
+ throw new Test262Error('#1: If string.charAt(k+2) does not represent hexadecimal digits, throw URIError');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.3_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.3_T1.js
new file mode 100644
index 0000000000..cf1e769229
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.3_T1.js
@@ -0,0 +1,56 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: If B = 10xxxxxx or B = 11111xxx, throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = 10xxxxxx -> B in [0x80 - 0xBF]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var index = 0x80; index <= 0xBF; index++) {
+ count++;
+ var hex = decimalToPercentHexString(index);
+ try {
+ decodeURI(hex);
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.3_T2.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.3_T2.js
new file mode 100644
index 0000000000..d859649e03
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.3_T2.js
@@ -0,0 +1,56 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: If B = 10xxxxxx or B = 11111xxx, throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = 11111xxx -> B in [0xF8 - 0xFF]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var index = 0xF8; index <= 0xFF; index++) {
+ count++;
+ var hex = decimalToPercentHexString(index);
+ try {
+ decodeURI(hex);
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.4_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.4_T1.js
new file mode 100644
index 0000000000..778deb0de3
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.4_T1.js
@@ -0,0 +1,64 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: If B = 110xxxxx (n = 2) and (k + 2) + 3 >= length, throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xC0 - 0xDF]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var index = 0xC0; index <= 0xDF; index++) {
+ count++;
+ var str = "";
+ var result = true;
+ for (var len = 0; len < 3; len++) {
+ var hex = decimalToPercentHexString(index);
+ try {
+ decodeURI(hex + str);
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ str = str + "1";
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.5_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.5_T1.js
new file mode 100644
index 0000000000..ad5cfa3473
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.5_T1.js
@@ -0,0 +1,64 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: If B = 1110xxxx (n = 3) and (k + 2) + 6 >= length, throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xE0 - 0xEF]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var index = 0xE0; index <= 0xEF; index++) {
+ count++;
+ var str = "";
+ var result = true;
+ for (var len = 0; len < 6; len++) {
+ var hex = decimalToPercentHexString(index);
+ try {
+ decodeURI(hex + str);
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ str = str + "1";
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.6_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.6_T1.js
new file mode 100644
index 0000000000..8e188e178b
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.6_T1.js
@@ -0,0 +1,64 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: If B = 11110xxx (n = 4) and (k + 2) + 9 >= length, throw URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xF0 - 0xF7]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var index = 0xF0; index <= 0xF7; index++) {
+ count++;
+ var str = "";
+ var result = true;
+ for (var len = 0; len < 9; len++) {
+ var hex = decimalToPercentHexString(index);
+ try {
+ decodeURI(hex + str);
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ result = false;
+ str = str + "1";
+ }
+ if (result !== true) {
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.7_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.7_T1.js
new file mode 100644
index 0000000000..3da28ddfd4
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.7_T1.js
@@ -0,0 +1,58 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 110xxxxx (n = 2) and string.charAt(k + 3) not equal "%", throw
+ URIError
+esid: sec-decodeuri-encodeduri
+description: Complex tests. B = [0xC0 - 0xDF]
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var index = 0xC0; index <= 0xDF; index++) {
+ count++;
+ var hex = decimalToPercentHexString(index);
+ try {
+ decodeURI(hex + "111");
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.8_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.8_T1.js
new file mode 100644
index 0000000000..9da33168ac
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.8_T1.js
@@ -0,0 +1,59 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 1110xxxx (n = 3) and string.charAt(k + 3),
+ string.charAt(k + 6) not equal "%", throw URIError
+esid: sec-decodeuri-encodeduri
+description: >
+ Complex tests. B = [0xE0 - 0xEF], string.charAt(k + 3) not equal "%"
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var index = 0xE0; index <= 0xEF; index++) {
+ count++;
+ var hex = decimalToPercentHexString(index);
+ try {
+ decodeURI(hex + "111%A0");
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.8_T2.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.8_T2.js
new file mode 100644
index 0000000000..268d8a8dcd
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.8_T2.js
@@ -0,0 +1,59 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 1110xxxx (n = 3) and string.charAt(k + 3),
+ string.charAt(k + 6) not equal "%", throw URIError
+esid: sec-decodeuri-encodeduri
+description: >
+ Complex tests. B = [0xE0 - 0xEF], string.charAt(k + 6) not equal "%"
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var index = 0xE0; index <= 0xEF; index++) {
+ count++;
+ var hex = decimalToPercentHexString(index);
+ try {
+ decodeURI(hex + "%A0111");
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.9_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.9_T1.js
new file mode 100644
index 0000000000..1d2cfa2d33
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.9_T1.js
@@ -0,0 +1,59 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 11110xxx (n = 4) and string.charAt(k + 3),
+ string.charAt(k + 6), string.charAt(k + 9) not equal "%", throw URIError
+esid: sec-decodeuri-encodeduri
+description: >
+ Complex tests. B = [0xF0 - 0x0F7], string.charAt(k + 3) not equal "%"
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var index = 0xF0; index <= 0xF7; index++) {
+ count++;
+ var hex = decimalToPercentHexString(index);
+ try {
+ decodeURI(hex + "111%A0%A0");
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.9_T2.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.9_T2.js
new file mode 100644
index 0000000000..8265249c58
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.9_T2.js
@@ -0,0 +1,59 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 11110xxx (n = 4) and string.charAt(k + 3),
+ string.charAt(k + 6), string.charAt(k + 9) not equal "%", throw URIError
+esid: sec-decodeuri-encodeduri
+description: >
+ Complex tests. B = [0xF0 - 0x0F7], string.charAt(k + 6) not equal "%"
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var index = 0xF0; index <= 0xF7; index++) {
+ count++;
+ var hex = decimalToPercentHexString(index);
+ try {
+ decodeURI(hex + "%A0111%A0");
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.9_T3.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.9_T3.js
new file mode 100644
index 0000000000..db9a911e98
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A1.9_T3.js
@@ -0,0 +1,59 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B = 11110xxx (n = 4) and string.charAt(k + 3),
+ string.charAt(k + 6), string.charAt(k + 9) not equal "%", throw URIError
+esid: sec-decodeuri-encodeduri
+description: >
+ Complex tests. B = [0xF0 - 0x0F7], string.charAt(k + 9) not equal "%"
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var index = 0xF0; index <= 0xF7; index++) {
+ count++;
+ var hex = decimalToPercentHexString(index);
+ try {
+ decodeURI(hex + "%A0%A0111");
+ } catch (e) {
+ if ((e instanceof URIError) === true) continue;
+ }
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.1_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.1_T1.js
new file mode 100644
index 0000000000..bb1ebebae6
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.1_T1.js
@@ -0,0 +1,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-decodeuri-encodeduri
+description: Complex tests
+includes: [decimalToHexString.js]
+---*/
+
+for (var indexI = 0; indexI <= 65535; indexI++) {
+ if (indexI !== 0x25) {
+ try {
+ var str = String.fromCharCode(indexI);
+ var differs = decodeURI(str) !== str;
+ } catch (e) {
+ throw new Test262Error('#' + decimalToHexString(indexI) + ' throws');
+ }
+ if (differs) {
+ throw new Test262Error('#' + decimalToHexString(indexI) + ' differs');
+ }
+ }
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.2_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.2_T1.js
new file mode 100644
index 0000000000..2fa68c02f0
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.2_T1.js
@@ -0,0 +1,60 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: If B1 = 0xxxxxxxx ([0x00 - 0x7F]), without [uriReserved, #], return B1
+esid: sec-decodeuri-encodeduri
+description: Complex tests, use RFC 3629
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+var uriReserved = [";", "/", "?", ":", "@", "&", "=", "+", "$", ","];
+l:
+ for (var indexB1 = 0x00; indexB1 <= 0x7F; indexB1++) {
+ count++;
+ var hexB1 = decimalToPercentHexString(indexB1);
+ var index = indexB1;
+ var hex = String.fromCharCode(index);
+ for (var indexC = 0; indexC < uriReserved.length; indexC++) {
+ if (hex === uriReserved[indexC]) continue l;
+ }
+ if (hex === "#") continue;
+ if (decodeURI(hexB1) === hex) continue;
+
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+ }
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.3_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.3_T1.js
new file mode 100644
index 0000000000..46c1d9e53b
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.3_T1.js
@@ -0,0 +1,59 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B1 = 110xxxxx ([0xC0 - 0xDF]), B2 = 10xxxxxx ([0x80 - 0xBF), without
+ B1 = [0xC0, 0xC1], return UTF8(B1, B2)
+esid: sec-decodeuri-encodeduri
+description: Complex tests, use RFC 3629
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB1 = 0xC2; indexB1 <= 0xDF; indexB1++) {
+ var hexB1 = decimalToPercentHexString(indexB1);
+ for (var indexB2 = 0x80; indexB2 <= 0xBF; indexB2++) {
+ count++;
+ var hexB1_B2 = hexB1 + decimalToPercentHexString(indexB2);
+ var index = (indexB1 & 0x1F) * 0x40 + (indexB2 & 0x3F);
+ if (decodeURI(hexB1_B2) === String.fromCharCode(index)) continue;
+
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.4_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.4_T1.js
new file mode 100644
index 0000000000..bba2c47ca1
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.4_T1.js
@@ -0,0 +1,65 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B1 = 1110xxxx ([0xE0 - 0xEF]), B2, B3 = 10xxxxxxx ([0x80 - 0xBF]),
+ without [B1, B2] = [0xE0, 0x80 - 0x9F], [0xED, 0xA0 - 0xBF] (0xD800 -
+ 0xDFFF), return UTF8(B1, B2, B3)
+esid: sec-decodeuri-encodeduri
+description: Complex tests, use RFC 3629
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB1 = 0xE0; indexB1 <= 0xEF; indexB1++) {
+ var hexB1 = decimalToPercentHexString(indexB1);
+ for (var indexB2 = 0x80; indexB2 <= 0xBF; indexB2++) {
+ if ((indexB1 === 0xE0) && (indexB2 <= 0x9F)) continue;
+ if ((indexB1 === 0xED) && (0xA0 <= indexB2)) continue;
+ var hexB1_B2 = hexB1 + decimalToPercentHexString(indexB2);
+ for (var indexB3 = 0x80; indexB3 <= 0xBF; indexB3++) {
+ count++;
+ var hexB1_B2_B3 = hexB1_B2 + decimalToPercentHexString(indexB3);
+ var index = (indexB1 & 0x0F) * 0x1000 + (indexB2 & 0x3F) * 0x40 + (indexB3 & 0x3F);
+ if (decodeURI(hexB1_B2_B3) === String.fromCharCode(index)) continue;
+
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+ }
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.5_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.5_T1.js
new file mode 100644
index 0000000000..68c91cc3be
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A2.5_T1.js
@@ -0,0 +1,70 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If B1 = 11110xxx ([0xF0 - 0x0F4]), B2, B3, B4 = 10xxxxxxx ([0x80 -
+ 0xBF]), without [B1, B2] = [0xF0, 0x80 - 0x9F], [0xF4, 0x90 - 0xBF],
+ return UTF8(B1, B2, B3, B4)
+esid: sec-decodeuri-encodeduri
+description: Complex tests, use RFC 3629
+includes: [decimalToHexString.js]
+---*/
+
+var errorCount = 0;
+var count = 0;
+var indexP;
+var indexO = 0;
+
+for (var indexB1 = 0xF0; indexB1 <= 0xF4; indexB1++) {
+ var hexB1 = decimalToPercentHexString(indexB1);
+ for (var indexB2 = 0x80; indexB2 <= 0xBF; indexB2++) {
+ if ((indexB1 === 0xF0) && (indexB2 <= 0x9F)) continue;
+ if ((indexB1 === 0xF4) && (indexB2 >= 0x90)) continue;
+ var hexB1_B2 = hexB1 + decimalToPercentHexString(indexB2);
+ for (var indexB3 = 0x80; indexB3 <= 0xBF; indexB3++) {
+ var hexB1_B2_B3 = hexB1_B2 + decimalToPercentHexString(indexB3);
+ for (var indexB4 = 0x80; indexB4 <= 0xBF; indexB4++) {
+ var hexB1_B2_B3_B4 = hexB1_B2_B3 + decimalToPercentHexString(indexB4);
+ count++;
+ var index = (indexB1 & 0x07) * 0x40000 + (indexB2 & 0x3F) * 0x1000 + (indexB3 & 0x3F) * 0x40 + (indexB4 & 0x3F);
+ var L = ((index - 0x10000) & 0x03FF) + 0xDC00;
+ var H = (((index - 0x10000) >> 10) & 0x03FF) + 0xD800;
+ if (decodeURI(hexB1_B2_B3_B4) === String.fromCharCode(H, L)) continue;
+
+ if (indexO === 0) {
+ indexO = index;
+ } else {
+ if ((index - indexP) !== 1) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ }
+ else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ indexO = index;
+ }
+ }
+ indexP = index;
+ errorCount++;
+ }
+ }
+ }
+}
+
+if (errorCount > 0) {
+ if ((indexP - indexO) !== 0) {
+ var hexP = decimalToHexString(indexP);
+ var hexO = decimalToHexString(indexO);
+ throw new Test262Error('#' + hexO + '-' + hexP + ' ');
+ } else {
+ var hexP = decimalToHexString(indexP);
+ throw new Test262Error('#' + hexP + ' ');
+ }
+ throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' ');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A3_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A3_T1.js
new file mode 100644
index 0000000000..eb72d8b5f5
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A3_T1.js
@@ -0,0 +1,67 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ Let reservedURISet be a string containing one instance of each character valid
+ in uriReserved plus "#"
+esid: sec-decodeuri-encodeduri
+description: Checking all character in reservedURISet. HexDigit in [0..9, A..F]
+---*/
+
+//CHECK#1
+if (decodeURI("%3B") !== "%3B") {
+ throw new Test262Error('#1: decodeURI("%3B") equal "%3B", not ";"');
+}
+
+//CHECK#2
+if (decodeURI("%2F") !== "%2F") {
+ throw new Test262Error('#2: decodeURI("%2F") equal "%2F", not "/"');
+}
+
+//CHECK#3
+if (decodeURI("%3F") !== "%3F") {
+ throw new Test262Error('#3: decodeURI("%3F") equal "%3F", not "?"');
+}
+
+//CHECK#4
+if (decodeURI("%3A") !== "%3A") {
+ throw new Test262Error('#4: decodeURI("%3A") equal "%3A", not ":"');
+}
+
+//CHECK#5
+if (decodeURI("%40") !== "%40") {
+ throw new Test262Error('#5: decodeURI("%40") equal "%40", not "@"');
+}
+
+//CHECK#6
+if (decodeURI("%26") !== "%26") {
+ throw new Test262Error('#6: decodeURI("%26") equal "%26", not "&"');
+}
+
+//CHECK#7
+if (decodeURI("%3D") !== "%3D") {
+ throw new Test262Error('#7.1: decodeURI("%3D") equal "%3D", not "="');
+}
+
+//CHECK#8
+if (decodeURI("%2B") !== "%2B") {
+ throw new Test262Error('#8.1: decodeURI("%2B") equal "%2B", not "+"');
+}
+
+//CHECK#9
+if (decodeURI("%24") !== "%24") {
+ throw new Test262Error('#9: decodeURI("%24") equal "%24", not "$"');
+}
+
+//CHECK#10
+if (decodeURI("%2C") !== "%2C") {
+ throw new Test262Error('#10: decodeURI("%2C") equal "%2C", not ","');
+}
+
+//CHECK#11
+if (decodeURI("%23") !== "%23") {
+ throw new Test262Error('#11: decodeURI("%23") equal "%23", not "#"');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A3_T2.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A3_T2.js
new file mode 100644
index 0000000000..76aabbe1d8
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A3_T2.js
@@ -0,0 +1,67 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ Let reservedURISet be a string containing one instance of each character valid
+ in uriReserved plus "#"
+esid: sec-decodeuri-encodeduri
+description: Checking all character in reservedURISet. HexDigit in [0..9, a..f]
+---*/
+
+//CHECK#1
+if (decodeURI("%3b") !== "%3b") {
+ throw new Test262Error('#1: decodeURI("%3b") equal "%3b", not ";" or "%3B"');
+}
+
+//CHECK#2
+if (decodeURI("%2f") !== "%2f") {
+ throw new Test262Error('#2: decodeURI("%2f") equal "%2f", not "/" or "%2F"');
+}
+
+//CHECK#3
+if (decodeURI("%3f") !== "%3f") {
+ throw new Test262Error('#3: decodeURI("%3f") equal "%3f", not "?" or "%3F"');
+}
+
+//CHECK#4
+if (decodeURI("%3a") !== "%3a") {
+ throw new Test262Error('#4: decodeURI("%3a") equal "%3a", not ":" or "%3A"');
+}
+
+//CHECK#5
+if (decodeURI("%40") !== "%40") {
+ throw new Test262Error('#5: decodeURI("%40") equal "%40", not "@"');
+}
+
+//CHECK#6
+if (decodeURI("%26") !== "%26") {
+ throw new Test262Error('#6: decodeURI("%26") equal "%26", not "&"');
+}
+
+//CHECK#7
+if (decodeURI("%3d") !== "%3d") {
+ throw new Test262Error('#7.1: decodeURI("%3d") equal "%3d", not "=" or "%3D"');
+}
+
+//CHECK#8
+if (decodeURI("%2b") !== "%2b") {
+ throw new Test262Error('#8.1: decodeURI("%2b") equal "%2b", not "+" or "%2B"');
+}
+
+//CHECK#9
+if (decodeURI("%24") !== "%24") {
+ throw new Test262Error('#9: decodeURI("%24") equal "%24", not "$"');
+}
+
+//CHECK#10
+if (decodeURI("%2c") !== "%2c") {
+ throw new Test262Error('#10: decodeURI("%2c") equal "%2c", not "," or "%2C"');
+}
+
+//CHECK#11
+if (decodeURI("%23") !== "%23") {
+ throw new Test262Error('#11: decodeURI("%23") equal "%23", not "#"');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A3_T3.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A3_T3.js
new file mode 100644
index 0000000000..4079fb3320
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A3_T3.js
@@ -0,0 +1,22 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ Let reservedURISet be a string containing one instance of each character valid
+ in uriReserved plus "#"
+esid: sec-decodeuri-encodeduri
+description: Complex test
+---*/
+
+//CHECK#1
+if (decodeURI("%3B%2F%3F%3A%40%26%3D%2B%24%2C%23") !== "%3B%2F%3F%3A%40%26%3D%2B%24%2C%23") {
+ throw new Test262Error('#1: decodeURI("%3B%2F%3F%3A%40%26%3D%2B%24%2C%23") equal "%3B%2F%3F%3A%40%26%3D%2B%24%2C%23", not ";/?:@&=+$,#"');
+}
+
+//CHECK#2
+if (decodeURI("%3b%2f%3f%3a%40%26%3d%2b%24%2c%23") !== "%3b%2f%3f%3a%40%26%3d%2b%24%2c%23") {
+ throw new Test262Error('#2: decodeURI("%3b%2f%3f%3a%40%26%3d%2b%24%2c%23") equal "%3b%2f%3f%3a%40%26%3d%2b%24%2c%23", not ";/?:@&=+$,#" or "%3B%2F%3F%3A%40%26%3D%2B%24%2C%23"');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T1.js
new file mode 100644
index 0000000000..1114fb2b31
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T1.js
@@ -0,0 +1,25 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: URI tests
+esid: sec-decodeuri-encodeduri
+description: Checking ENGLISH ALPHABET
+---*/
+
+//CHECK#1
+if (decodeURI("http://unipro.ru/0123456789") !== "http://unipro.ru/0123456789") {
+ throw new Test262Error('#1: http://unipro.ru/0123456789');
+}
+
+//CHECK#2
+if (decodeURI("%41%42%43%44%45%46%47%48%49%4A%4B%4C%4D%4E%4F%50%51%52%53%54%55%56%57%58%59%5A") !== "ABCDEFGHIJKLMNOPQRSTUVWXYZ") {
+ throw new Test262Error('#2: ABCDEFGHIJKLMNOPQRSTUVWXYZ');
+}
+
+//CHECK#3
+if (decodeURI("%61%62%63%64%65%66%67%68%69%6A%6B%6C%6D%6E%6F%70%71%72%73%74%75%76%77%78%79%7A") !== "abcdefghijklmnopqrstuvwxyz") {
+ throw new Test262Error('#3: abcdefghijklmnopqrstuvwxyz');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T2.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T2.js
new file mode 100644
index 0000000000..843d496cef
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T2.js
@@ -0,0 +1,25 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: URI tests
+esid: sec-decodeuri-encodeduri
+description: Checking RUSSIAN ALPHABET
+---*/
+
+//CHECK#1
+if (decodeURI("http://ru.wikipedia.org/wiki/%d0%ae%D0%bd%D0%B8%D0%BA%D0%BE%D0%B4") !== "http://ru.wikipedia.org/wiki/Юникод") {
+ throw new Test262Error('#1: http://ru.wikipedia.org/wiki/Юникод');
+}
+
+//CHECK#2
+if (decodeURI("http://ru.wikipedia.org/wiki/%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4#%D0%A1%D1%81%D1%8B%D0%BB%D0%BA%D0%B8") !== "http://ru.wikipedia.org/wiki/Юникод#Ссылки") {
+ throw new Test262Error('#2: http://ru.wikipedia.org/wiki/Юникод#Ссылки');
+}
+
+//CHECK#3
+if (decodeURI("http://ru.wikipedia.org/wiki/%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4%23%D0%92%D0%B5%D1%80%D1%81%D0%B8%D0%B8%20%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4%D0%B0") !== "http://ru.wikipedia.org/wiki/Юникод%23Версии Юникода") {
+ throw new Test262Error('#3: http://ru.wikipedia.org/wiki/Юникод%23Версии Юникода');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T3.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T3.js
new file mode 100644
index 0000000000..1a7a1484ba
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T3.js
@@ -0,0 +1,30 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: URI tests
+esid: sec-decodeuri-encodeduri
+description: Checking URL with Line Terminator
+---*/
+
+//CHECK#1
+if (decodeURI("http://unipro.ru/%0Aabout") !== "http://unipro.ru/\nabout") {
+ throw new Test262Error('#1: http://unipro.ru/%A0about');
+}
+
+//CHECK#2
+if (decodeURI("http://unipro.ru/%0Babout") !== "http://unipro.ru/\vabout") {
+ throw new Test262Error('#2: http://unipro.ru/%0Babout');
+}
+
+//CHECK#3
+if (decodeURI("http://unipro.ru/%0Cabout") !== "http://unipro.ru/\fabout") {
+ throw new Test262Error('#3: http://unipro.ru/%0Cabout');
+}
+
+//CHECK#4
+if (decodeURI("http://unipro.ru/%0Dabout") !== "http://unipro.ru/\rabout") {
+ throw new Test262Error('#4: http://unipro.ru/%0Dabout');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T4.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T4.js
new file mode 100644
index 0000000000..7e76b8edae
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A4_T4.js
@@ -0,0 +1,30 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: URI tests
+esid: sec-decodeuri-encodeduri
+description: Test some url
+---*/
+
+//CHECK#1
+if (decodeURI("") !== "") {
+ throw new Test262Error('#1: ""');
+}
+
+//CHECK#2
+if (decodeURI("http:%2f%2Funipro.ru") !== "http:%2f%2Funipro.ru") {
+ throw new Test262Error('#2: http:%2f%2Funipro.ru');
+}
+
+//CHECK#3
+if (decodeURI("http://www.google.ru/support/jobs/bin/static.py%3Fpage%3dwhy-ru.html%26sid%3Dliveandwork") !== "http://www.google.ru/support/jobs/bin/static.py%3Fpage%3dwhy-ru.html%26sid%3Dliveandwork") {
+ throw new Test262Error('#3: http://www.google.ru/support/jobs/bin/static.py%3Fpage%3dwhy-ru.html%26sid%3Dliveandwork"');
+}
+
+//CHECK%234
+if (decodeURI("http://en.wikipedia.org/wiki/UTF-8%23Description") !== "http://en.wikipedia.org/wiki/UTF-8%23Description") {
+ throw new Test262Error('%234: http://en.wikipedia.org/wiki/UTF-8%23Description');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.1.js
new file mode 100644
index 0000000000..9d5d9afc82
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.1.js
@@ -0,0 +1,27 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The length property of decodeURI has the attribute DontEnum
+esid: sec-decodeuri-encodeduri
+description: Checking use propertyIsEnumerable, for-in
+---*/
+
+//CHECK#1
+if (decodeURI.propertyIsEnumerable('length') !== false) {
+ throw new Test262Error('#1: decodeURI.propertyIsEnumerable(\'length\') === false. Actual: ' + (decodeURI.propertyIsEnumerable('length')));
+}
+
+//CHECK#2
+var result = true;
+for (var p in decodeURI) {
+ if (p === "length") {
+ result = false;
+ }
+}
+
+if (result !== true) {
+ throw new Test262Error('#2: result = true; for (p in decodeURI) { if (p === "length") result = false; } result === true;');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.2.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.2.js
new file mode 100644
index 0000000000..c211ab452f
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.2.js
@@ -0,0 +1,27 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The length property of decodeURI does not have the attribute DontDelete
+esid: sec-decodeuri-encodeduri
+description: Checking use hasOwnProperty, delete
+---*/
+
+//CHECK#1
+if (decodeURI.hasOwnProperty('length') !== true) {
+ throw new Test262Error('#1: decodeURI.hasOwnProperty(\'length\') === true. Actual: ' + (decodeURI.hasOwnProperty('length')));
+}
+
+delete decodeURI.length;
+
+//CHECK#2
+if (decodeURI.hasOwnProperty('length') !== false) {
+ throw new Test262Error('#2: delete decodeURI.length; decodeURI.hasOwnProperty(\'length\') === false. Actual: ' + (decodeURI.hasOwnProperty('length')));
+}
+
+//CHECK#3
+if (decodeURI.length === undefined) {
+ throw new Test262Error('#3: delete decodeURI.length; decodeURI.length !== undefined');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.3.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.3.js
new file mode 100644
index 0000000000..23296f5668
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.3.js
@@ -0,0 +1,18 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The length property of decodeURI has the attribute ReadOnly
+esid: sec-decodeuri-encodeduri
+description: Checking if varying the length property fails
+includes: [propertyHelper.js]
+---*/
+
+//CHECK#1
+var x = decodeURI.length;
+verifyNotWritable(decodeURI, "length", null, Infinity);
+if (decodeURI.length !== x) {
+ throw new Test262Error('#1: x = decodeURI.length; decodeURI.length = Infinity; decodeURI.length === x. Actual: ' + (decodeURI.length));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.4.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.4.js
new file mode 100644
index 0000000000..93fde36ac7
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.4.js
@@ -0,0 +1,15 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The length property of decodeURI is 1
+esid: sec-decodeuri-encodeduri
+description: decodeURI.length === 1
+---*/
+
+//CHECK#1
+if (decodeURI.length !== 1) {
+ throw new Test262Error('#1: decodeURI.length === 1. Actual: ' + (decodeURI.length));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.5.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.5.js
new file mode 100644
index 0000000000..717a76bc72
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.5.js
@@ -0,0 +1,27 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The decodeURI property has the attribute DontEnum
+esid: sec-decodeuri-encodeduri
+description: Checking use propertyIsEnumerable, for-in
+---*/
+
+//CHECK#1
+if (this.propertyIsEnumerable('decodeURI') !== false) {
+ throw new Test262Error('#1: this.propertyIsEnumerable(\'decodeURI\') === false. Actual: ' + (this.propertyIsEnumerable('decodeURI')));
+}
+
+//CHECK#2
+var result = true;
+for (var p in this) {
+ if (p === "decodeURI") {
+ result = false;
+ }
+}
+
+if (result !== true) {
+ throw new Test262Error('#2: result = true; for (p in this) { if (p === "decodeURI") result = false; } result === true;');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.6.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.6.js
new file mode 100644
index 0000000000..b48cf69f23
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.6.js
@@ -0,0 +1,15 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The decodeURI property has not prototype property
+esid: sec-decodeuri-encodeduri
+description: Checking decodeURI.prototype
+---*/
+
+//CHECK#1
+if (decodeURI.prototype !== undefined) {
+ throw new Test262Error('#1: decodeURI.prototype === undefined. Actual: ' + (decodeURI.prototype));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.7.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.7.js
new file mode 100644
index 0000000000..05f8876375
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A5.7.js
@@ -0,0 +1,23 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The decodeURI property can't be used as constructor
+esid: sec-decodeuri-encodeduri
+description: >
+ If property does not implement the internal [[Construct]] method,
+ throw a TypeError exception
+---*/
+
+//CHECK#1
+
+try {
+ new decodeURI();
+ throw new Test262Error('#1.1: new decodeURI() throw TypeError. Actual: ' + (new decodeURI()));
+} catch (e) {
+ if ((e instanceof TypeError) !== true) {
+ throw new Test262Error('#1.2: new decodeURI() throw TypeError. Actual: ' + (e));
+ }
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A6_T1.js b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A6_T1.js
new file mode 100644
index 0000000000..1fe92dff16
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/S15.1.3.1_A6_T1.js
@@ -0,0 +1,129 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Operator use ToString
+esid: sec-decodeuri-encodeduri
+description: If Type(value) is Object, evaluate ToPrimitive(value, String)
+---*/
+
+//CHECK#1
+var object = {
+ valueOf: function() {
+ return "%5E"
+ }
+};
+if (decodeURI(object) !== "[object Object]") {
+ throw new Test262Error('#1: var object = {valueOf: function() {return "%5E"}}; decodeURI(object) === [object Object]. Actual: ' + (decodeURI(object)));
+}
+
+//CHECK#2
+var object = {
+ valueOf: function() {
+ return ""
+ },
+ toString: function() {
+ return "%5E"
+ }
+};
+if (decodeURI(object) !== "^") {
+ throw new Test262Error('#2: var object = {valueOf: function() {return ""}, toString: function() {return "%5E"}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object)));
+}
+
+//CHECK#3
+var object = {
+ valueOf: function() {
+ return "%5E"
+ },
+ toString: function() {
+ return {}
+ }
+};
+if (decodeURI(object) !== "^") {
+ throw new Test262Error('#3: var object = {valueOf: function() {return "%5E"}, toString: function() {return {}}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object)));
+}
+
+//CHECK#4
+try {
+ var object = {
+ valueOf: function() {
+ throw "error"
+ },
+ toString: function() {
+ return "%5E"
+ }
+ };
+ if (decodeURI(object) !== "^") {
+ throw new Test262Error('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return "%5E"}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object)));
+ }
+}
+catch (e) {
+ if (e === "error") {
+ throw new Test262Error('#4.2: var object = {valueOf: function() {throw "error"}, toString: function() {return "%5E"}}; decodeURI(object) not throw "error"');
+ } else {
+ throw new Test262Error('#4.3: var object = {valueOf: function() {throw "error"}, toString: function() {return "%5E"}}; decodeURI(object) not throw Error. Actual: ' + (e));
+ }
+}
+
+//CHECK#5
+var object = {
+ toString: function() {
+ return "%5E"
+ }
+};
+if (decodeURI(object) !== "^") {
+ throw new Test262Error('#5: var object = {toString: function() {return "%5E"}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object)));
+}
+
+//CHECK#6
+var object = {
+ valueOf: function() {
+ return {}
+ },
+ toString: function() {
+ return "%5E"
+ }
+}
+if (decodeURI(object) !== "^") {
+ throw new Test262Error('#6: var object = {valueOf: function() {return {}}, toString: function() {return "%5E"}}; decodeURI(object) === "^". Actual: ' + (decodeURI(object)));
+}
+
+//CHECK#7
+try {
+ var object = {
+ valueOf: function() {
+ return "%5E"
+ },
+ toString: function() {
+ throw "error"
+ }
+ };
+ decodeURI(object);
+ throw new Test262Error('#7.1: var object = {valueOf: function() {return "%5E"}, toString: function() {throw "error"}}; decodeURI(object) throw "error". Actual: ' + (decodeURI(object)));
+}
+catch (e) {
+ if (e !== "error") {
+ throw new Test262Error('#7.2: var object = {valueOf: function() {return "%5E"}, toString: function() {throw "error"}}; decodeURI(object) throw "error". Actual: ' + (e));
+ }
+}
+
+//CHECK#8
+try {
+ var object = {
+ valueOf: function() {
+ return {}
+ },
+ toString: function() {
+ return {}
+ }
+ };
+ decodeURI(object);
+ throw new Test262Error('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; decodeURI(object) throw TypeError. Actual: ' + (decodeURI(object)));
+}
+catch (e) {
+ if ((e instanceof TypeError) !== true) {
+ throw new Test262Error('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; decodeURI(object) throw TypeError. Actual: ' + (e));
+ }
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/browser.js b/js/src/tests/test262/built-ins/decodeURI/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/browser.js
diff --git a/js/src/tests/test262/built-ins/decodeURI/name.js b/js/src/tests/test262/built-ins/decodeURI/name.js
new file mode 100644
index 0000000000..49e92af77d
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/name.js
@@ -0,0 +1,28 @@
+// Copyright (C) 2015 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-decodeuri-encodeduri
+description: >
+ decodeURI.name is "decodeURI".
+info: |
+ decodeURI (encodedURI)
+
+ 17 ECMAScript Standard Built-in Objects:
+ Every built-in Function object, including constructors, that is not
+ identified as an anonymous function has a name property whose value
+ is a String.
+
+ Unless otherwise specified, the name property of a built-in Function
+ object, if it exists, has the attributes { [[Writable]]: false,
+ [[Enumerable]]: false, [[Configurable]]: true }.
+includes: [propertyHelper.js]
+---*/
+
+assert.sameValue(decodeURI.name, "decodeURI");
+
+verifyNotEnumerable(decodeURI, "name");
+verifyNotWritable(decodeURI, "name");
+verifyConfigurable(decodeURI, "name");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/not-a-constructor.js b/js/src/tests/test262/built-ins/decodeURI/not-a-constructor.js
new file mode 100644
index 0000000000..00a1e05e4c
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/not-a-constructor.js
@@ -0,0 +1,31 @@
+// Copyright (C) 2020 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-ecmascript-standard-built-in-objects
+description: >
+ decodeURI does not implement [[Construct]], is not new-able
+info: |
+ ECMAScript Function Objects
+
+ Built-in function objects that are not identified as constructors do not
+ implement the [[Construct]] internal method unless otherwise specified in
+ the description of a particular function.
+
+ sec-evaluatenew
+
+ ...
+ 7. If IsConstructor(constructor) is false, throw a TypeError exception.
+ ...
+includes: [isConstructor.js]
+features: [Reflect.construct, arrow-function]
+---*/
+
+assert.sameValue(isConstructor(decodeURI), false, 'isConstructor(decodeURI) must return false');
+
+assert.throws(TypeError, () => {
+ new decodeURI('');
+}, '`new decodeURI(\'\')` throws TypeError');
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/prop-desc.js b/js/src/tests/test262/built-ins/decodeURI/prop-desc.js
new file mode 100644
index 0000000000..b854ba429f
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/prop-desc.js
@@ -0,0 +1,19 @@
+// Copyright (C) 2019 Bocoup. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-decodeuri-encodeduri
+description: >
+ Property descriptor for decodeURI
+info: |
+ Every other data property described in clauses 18 through 26 and in Annex B.2
+ has the attributes { [[Writable]]: true, [[Enumerable]]: false,
+ [[Configurable]]: true } unless otherwise specified.
+includes: [propertyHelper.js]
+---*/
+
+verifyNotEnumerable(this, "decodeURI");
+verifyWritable(this, "decodeURI");
+verifyConfigurable(this, "decodeURI");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/decodeURI/shell.js b/js/src/tests/test262/built-ins/decodeURI/shell.js
new file mode 100644
index 0000000000..a9bb766df3
--- /dev/null
+++ b/js/src/tests/test262/built-ins/decodeURI/shell.js
@@ -0,0 +1,52 @@
+// GENERATED, DO NOT EDIT
+// file: decimalToHexString.js
+// Copyright (C) 2017 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: |
+ Collection of functions used to assert the correctness of various encoding operations.
+defines: [decimalToHexString, decimalToPercentHexString]
+---*/
+
+function decimalToHexString(n) {
+ var hex = "0123456789ABCDEF";
+ n >>>= 0;
+ var s = "";
+ while (n) {
+ s = hex[n & 0xf] + s;
+ n >>>= 4;
+ }
+ while (s.length < 4) {
+ s = "0" + s;
+ }
+ return s;
+}
+
+function decimalToPercentHexString(n) {
+ var hex = "0123456789ABCDEF";
+ return "%" + hex[(n >> 4) & 0xf] + hex[n & 0xf];
+}
+
+// file: isConstructor.js
+// Copyright (C) 2017 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: |
+ Test if a given function is a constructor function.
+defines: [isConstructor]
+features: [Reflect.construct]
+---*/
+
+function isConstructor(f) {
+ if (typeof f !== "function") {
+ throw new Test262Error("isConstructor invoked with a non-function value");
+ }
+
+ try {
+ Reflect.construct(function(){}, [], f);
+ } catch (e) {
+ return false;
+ }
+ return true;
+}