{"ScriptPreparationCode":"var jsonObject = \u0027{\u0022value1\u0022: 15, \u0022value2\u0022: 16, \u0022value3\u0022: \u0022value\u0022}\u0027;\r\nvar stringObject = \u002715 16 value\u0027;\r\n\r\nvar bigJsonObject = \u0027{\u0022value1\u0022: 15, \u0022value2\u0022: 16, \u0022value3\u0022: \u0022valueaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\u0022}\u0027;\r\n\r\nvar bigStringObject = \u002715 16 valueaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\u0027;\r\n\r\nfunction parseToString(stringValue, number) {\r\n var result = [];\r\n \r\n var prevSpaceIndex = -1;\r\n for(var i = 0; i \u003C number - 1; i\u002B\u002B) {\r\n var spaceIndex = stringValue.indexOf(\u0027 \u0027, prevSpaceIndex \u002B 1);\r\n \r\n result[i] = stringValue.substr(prevSpaceIndex \u002B 1, spaceIndex - prevSpaceIndex - 1);\r\n \r\n prevSpaceIndex = spaceIndex;\r\n }\r\n \r\n result[result.length] = stringValue.substr(spaceIndex\u002B1);\r\n\t\r\n\treturn result;\r\n}\r\n\r\nfunction parseTestObjectUseArray(value) {\r\n var array = parseToString(value, 3);\r\n \r\n return {\r\n value1: array[0],\r\n value2: array[1],\r\n value3: array[2],\r\n }; \r\n}\r\n\r\nfunction parseTestObject(stringValue) {\r\n var firstSpace = stringValue.indexOf(\u0027 \u0027);\r\n var secondSpace = stringValue.indexOf(\u0027 \u0027, firstSpace \u002B 1);\r\n\r\n if(firstSpace == -1 || secondSpace == -1) {\r\n\t throw Error(\u0022Malformed message\u0022);\r\n }\r\n\r\n return {\r\n value1: stringValue.substr(0, firstSpace),\r\n value2: stringValue.substr(firstSpace \u002B 1, secondSpace - firstSpace - 1),\r\n value3: stringValue.substr(secondSpace \u002B 1)\r\n };\r\n}\r\n","TestCases":[{"Name":"parseTestObject(stringObject);","Code":"var object = parseTestObject(stringObject);","IsDeferred":false},{"Name":"parseTestObject(bigStringObject);","Code":"var object = parseTestObject(bigStringObject);","IsDeferred":false},{"Name":"JSON.parse(bigJsonObject);","Code":"JSON.parse(bigJsonObject);","IsDeferred":false},{"Name":"JSON.parse(jsonObject);","Code":"JSON.parse(jsonObject);","IsDeferred":false},{"Name":"parseTestObjectUseArray(bigStringObject);","Code":"var object = parseTestObjectUseArray(bigStringObject);","IsDeferred":false},{"Name":"parseTestObjectUseArray(stringObject);","Code":"var object = parseTestObjectUseArray(stringObject);","IsDeferred":false},{"Name":"stringObject to vars","Code":"var firstSpace = stringObject.indexOf(\u0027 \u0027);\r\nvar secondSpace = stringObject.indexOf(\u0027 \u0027, firstSpace \u002B 1);\r\n\r\nif(firstSpace == -1 || secondSpace == -1) {\r\n\tthrow Error(\u0022Malformed message\u0022);\r\n}\r\n\r\nvar value1 = stringObject.substr(0, firstSpace);\r\nvar value2 = stringObject.substr(firstSpace \u002B 1, secondSpace - firstSpace - 1);\r\nvar value3 = stringObject.substr(secondSpace \u002B 1);","IsDeferred":false},{"Name":"bigStringObject to vars","Code":"var firstSpace = bigStringObject.indexOf(\u0027 \u0027);\r\nvar secondSpace = bigStringObject.indexOf(\u0027 \u0027, firstSpace \u002B 1);\r\n\r\nif(firstSpace == -1 || secondSpace == -1) {\r\n\tthrow Error(\u0022Malformed message\u0022);\r\n}\r\n\r\nvar value1 = bigStringObject.substr(0, firstSpace);\r\nvar value2 = bigStringObject.substr(firstSpace \u002B 1, secondSpace - firstSpace - 1);\r\nvar value3 = bigStringObject.substr(secondSpace \u002B 1);","IsDeferred":false}]}