{"ScriptPreparationCode":"function h1(tag, props) {\r\n props = Object.assign({}, props);\r\n let length = arguments.length;\r\n if (length \u003E 3) {\r\n const children = [];\r\n while (length-- \u003E 2) {\r\n children[length - 2] = arguments[length];\r\n }\r\n props.children = children;\r\n } else if (length === 3) {\r\n props.children = arguments[2];\r\n }\r\n return {\r\n tag,\r\n props\r\n };\r\n}\r\n\r\nfunction h2(tag, props, ...children) {\r\n props = Object.assign({}, props);\r\n if (children.length \u003E 1) {\r\n props.children = children;\r\n } else if (children.length === 1) {\r\n props.children = children[0];\r\n }\r\n return {\r\n tag,\r\n props\r\n };\r\n}","TestCases":[{"Name":"arguments","Code":"const els = [];\r\nfor (let i = 0; i \u003C 1000; i\u002B\u002B) {\r\n if (i % 3 === 0) {\r\n els.push(h1(\u0027div\u0027, {class: \u0027foo\u0027}, i, i \u002B 1, i \u002B 2));\r\n } else {\r\n els.push(h1(\u0027div\u0027, {class: \u0027foo\u0027}, i));\r\n }\r\n}","IsDeferred":false},{"Name":"rest parameter","Code":"const els = [];\r\nfor (let i = 0; i \u003C 1000; i\u002B\u002B) {\r\n if (i % 3 === 0) {\r\n els.push(h2(\u0027div\u0027, {class: \u0027foo\u0027}, i, i \u002B 1, i \u002B 2));\r\n } else {\r\n els.push(h2(\u0027div\u0027, {class: \u0027foo\u0027}, i));\r\n }\r\n}","IsDeferred":false}]}