{"ScriptPreparationCode":"window.htmlStr = \u0060\u003Cdiv\u003E\r\n\t\u003Cinput name=\u0022test\u0022 value=\u0022test\u0022 /\u003E\r\n \u003Cimg /\u003E\r\n\u003C/div\u003E\u0060;","TestCases":[{"Name":"Text node","Code":"const escapeElement = document.createElement(\u0027span\u0027);\r\nconst escapeTextNode = document.createTextNode(\u0027\u0027);\r\nescapeElement.append(escapeTextNode);\r\nfunction escape(str) {\r\n escapeTextNode.textContent = str;\r\n return escapeElement.innerHTML;\r\n}\r\n\r\nlet i = 0;\r\nfor (; i \u003C 10000; i\u002B\u002B) {\r\n escape(htmlStr);\r\n}","IsDeferred":false},{"Name":"Option node","Code":"const option = new Option(\u0027\u0027);\r\nfunction escape(str) {\r\n option.label = str;\r\n return option.label;\r\n}\r\n\r\nlet i = 0;\r\nfor (; i \u003C 10000; i\u002B\u002B) {\r\n escape(htmlStr);\r\n}","IsDeferred":false},{"Name":"Replace A","Code":"function escape(str) {\r\n const E = [\r\n [\u0027\u0026\u0027, \u0027\u0026amp;\u0027],\r\n [\u0027\u003C\u0027, \u0027\u0026lt;\u0027],\r\n [\u0027\u003E\u0027, \u0027\u0026gt;\u0027],\r\n [\u0022\u0027\u0022, \u0027\u0026apos;\u0027],\r\n [\u0027\u0022\u0027, \u0027\u0026quot;\u0027],\r\n ];\r\n\r\n return (v) =\u003E E.reduce((r, e) =\u003E str.replaceAll(e[0], e[1]), v);\r\n}\r\n\r\nlet i = 0;\r\nfor (; i \u003C 10000; i\u002B\u002B) {\r\n escape(htmlStr);\r\n}","IsDeferred":false},{"Name":"Replace B","Code":"function escape(str) {\r\n return str.replaceAll(\u0027\u0026\u0027, \u0027\u0026amp;\u0027)\r\n .replaceAll(\u0027\u003C\u0027, \u0027\u0026lt;\u0027)\r\n .replaceAll(\u0027\u003E\u0027, \u0027\u0026gt;\u0027)\r\n .replaceAll(\u0022\u0027\u0022, \u0027\u0026apos;\u0027)\r\n .replaceAll(\u0027\u0022\u0027, \u0027\u0026quot;\u0027);\r\n\r\n return (v) =\u003E E.reduce((r, e) =\u003E str.replaceAll(e[0], e[1]), v);\r\n}\r\n\r\nlet i = 0;\r\nfor (; i \u003C 10000; i\u002B\u002B) {\r\n escape(htmlStr);\r\n}","IsDeferred":false},{"Name":"Replace C","Code":"function escape(str) {\r\n return (\u0027\u0027 \u002B str).replace(/[^\\w. ]/gi, c =\u003E \u0027\u0026#\u0027 \u002B c.charCodeAt(0) \u002B \u0027;\u0027)\r\n}\r\n\r\nlet i = 0;\r\nfor (; i \u003C 10000; i\u002B\u002B) {\r\n escape(htmlStr);\r\n}","IsDeferred":false}]}