{"ScriptPreparationCode":"/*your preparation JavaScript code goes here\r\nTo execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/\r\nasync function globalMeasureThatScriptPrepareFunction() {\r\n // This function is optional, feel free to remove it.\r\n // await someThing();\r\n}","TestCases":[{"Name":"Class method","Code":"class TransformComponent {\r\n constructor(scaleX = 1.0, scaleY = 1.0, rotation = 0.0) {\r\n this.scaleX = scaleX;\r\n this.scaleY = scaleY;\r\n this.rotation = rotation;\r\n }\r\n \r\n scale(factor = 1.0) {\r\n this.scaleX *= factor;\r\n this.scaleY *= factor;\r\n }\r\n};\r\n\r\nfor(let i = 0; i \u003C 10000; i\u002B\u002B) {\r\n const transform = new TransformComponent(i, i, i);\r\n transform.scale(2.0);\r\n}","IsDeferred":false},{"Name":"Factory manager","Code":"const components = new Map;\r\nconst noop = () =\u003E {};\r\n\r\nconst componentsMethodCaller = (factory, methodName, ...values) =\u003E {\r\n const methods = components.get(factory);\r\n return (methods[methodName] || noop).apply(null, values);\r\n}\r\n\r\nconst transformFactory = (scaleX = 1.0, scaleY = 1.0, rotation = 0.0) =\u003E {\r\n return {\r\n scaleX,\r\n scaleY,\r\n rotation,\r\n };\r\n}\r\n\r\ncomponents.set(transformFactory, {\r\n scale(component, factor = 1.0) {\r\n component.scaleX *= factor;\r\n component.scaleY *= factor;\r\n },\r\n});\r\n\r\nfor(let i = 0; i \u003C 10000; i\u002B\u002B) {\r\n const transform = transformFactory(i, i, i);\r\n componentsMethodCaller(transformFactory, \u0027scale\u0027, 2.0);\r\n}","IsDeferred":false}]}