{"ScriptPreparationCode":"var ToStringFromUTF16_1 = (function() {\r\n var UTF16 = new TextDecoder(\u0022utf-16\u0022);\r\n return function(bytes, startIndex, length) {\r\n startIndex = startIndex | 0;\r\n if (typeof length !== \u0022undefined\u0022) length \u002B= startIndex;\r\n return UTF16.decode(bytes.subarray(startIndex, length));\r\n };\r\n })();\r\n\r\nvar ToStringFromUTF16_2 = (function() {\r\n var fromCharCode = String.fromCharCode;\r\n return function (bytes, startIndex, length) {\r\n startIndex = startIndex | 0;\r\n if (typeof length === \u0022undefined\u0022)\r\n length = bytes.length - startIndex;\r\n var s = \u0022\u0022,\r\n endIndex = startIndex \u002B length,\r\n i = startIndex;\r\n while (i \u003C endIndex) {\r\n var octet = bytes[i],\r\n bytesNeeded = 0,\r\n codePoint = 0;\r\n if (octet \u003C= 0x7F) {\r\n bytesNeeded = 0;\r\n codePoint = octet \u0026 0xFF;\r\n } else if (octet \u003C= 0xDF) {\r\n bytesNeeded = 1;\r\n codePoint = octet \u0026 0x1F;\r\n } else if (octet \u003C= 0xEF) {\r\n bytesNeeded = 2;\r\n codePoint = octet \u0026 0x0F;\r\n } else if (octet \u003C= 0xF4) {\r\n bytesNeeded = 3;\r\n codePoint = octet \u0026 0x07;\r\n }\r\n if (endIndex - i - bytesNeeded \u003E 0) {\r\n for (var j = 0; j \u003C bytesNeeded; j\u002B\u002B) {\r\n octet = bytes[i \u002B j \u002B 1];\r\n codePoint = (codePoint \u003C\u003C 6) | (octet \u0026 0x3F);\r\n }\r\n } else {\r\n codePoint = 0xFFFD; // REPLACEMENT CHARACTER\r\n bytesNeeded = endIndex - i;\r\n }\r\n //s \u002B= String.fromCodePoint(codePoint); \r\n //if (!(codePoint \u003C 0x10FFFF \u0026\u0026 (codePoint\u003E\u003E\u003E0) === codePoint))\r\n // throw RangeError(\u0022Invalid code point: \u0022 \u002B codePoint);\r\n if (codePoint \u003C= 0xFFFF) { // BMP code point\r\n s \u002B= fromCharCode(codePoint);\r\n } else {\r\n codePoint -= 0x10000;\r\n s \u002B= fromCharCode((codePoint \u003E\u003E 10) \u002B 0xD800, // high surrogate\r\n (codePoint % 0x400) \u002B 0xDC00); // low surrogate\r\n }\r\n i \u002B= bytesNeeded \u002B 1;\r\n }\r\n return s;\r\n };\r\n })();\r\n\r\nvar bytes = new Uint8Array([32, 0, 32, 0, 32, 0, 32, 0, 32, 0, 32, 0, 32, 0, 32, 0, 32, 0, 32, 0])","TestCases":[{"Name":"TextDecoder","Code":"ToStringFromUTF16_1(bytes);","IsDeferred":false},{"Name":"Concat","Code":"ToStringFromUTF16_2(bytes);","IsDeferred":false}]}