summaryrefslogtreecommitdiff
path: root/external/contributions/Google/sputnik_conformance_modified/15_Native/15.1_The_Global_Object/15.1.3_URI_Handling_Function_Properties/15.1.3.2_decodeURIComponent/S15.1.3.2_A1.11_T1.js
diff options
context:
space:
mode:
Diffstat (limited to 'external/contributions/Google/sputnik_conformance_modified/15_Native/15.1_The_Global_Object/15.1.3_URI_Handling_Function_Properties/15.1.3.2_decodeURIComponent/S15.1.3.2_A1.11_T1.js')
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/15_Native/15.1_The_Global_Object/15.1.3_URI_Handling_Function_Properties/15.1.3.2_decodeURIComponent/S15.1.3.2_A1.11_T1.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/external/contributions/Google/sputnik_conformance_modified/15_Native/15.1_The_Global_Object/15.1.3_URI_Handling_Function_Properties/15.1.3.2_decodeURIComponent/S15.1.3.2_A1.11_T1.js b/external/contributions/Google/sputnik_conformance_modified/15_Native/15.1_The_Global_Object/15.1.3_URI_Handling_Function_Properties/15.1.3.2_decodeURIComponent/S15.1.3.2_A1.11_T1.js
new file mode 100644
index 000000000..53930eec5
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/15_Native/15.1_The_Global_Object/15.1.3_URI_Handling_Function_Properties/15.1.3.2_decodeURIComponent/S15.1.3.2_A1.11_T1.js
@@ -0,0 +1,32 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @name: S15.1.3.2_A1.11_T1;
+ * @section: 15.1.3.2;
+ * @assertion: 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;
+ * @description: Complex tests, string.charAt(k + 4) and string.charAt(k + 5)
+ * do not represent hexadecimal digits;
+*/
+
+//CHECK
+result = true;
+var interval = [[0x00, 0x29], [0x40,0x40], [0x47, 0x60], [0x67, 0xFFFF]];
+for (indexI = 0; indexI < interval.length; indexI++) {
+ for (indexJ = interval[indexI][0]; indexJ <= interval[indexI][1]; indexJ++) {
+ try {
+ decodeURIComponent("%E0%" + String.fromCharCode(indexJ, indexJ) + "%A0");
+ result = false;
+ } catch (e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+ }
+ }
+}
+
+if (result !== true) {
+ $ERROR('#1: If B = 1110xxxx (n = 3) and (string.charAt(k + 4) and string.charAt(k + 5)) do not represent hexadecimal digits, throw URIError');
+}