{"ScriptPreparationCode":"function makeSpreadable(obj) {\r\n const proto = Object.getPrototypeOf(obj);\r\n const methods = Object.getOwnPropertyNames(proto);\r\n for (const method of methods) {\r\n if (method === \u0022constructor\u0022) continue;\r\n obj[method] = proto[method];\r\n }\r\n}\r\n\r\nclass Foo {\r\n constructor() {\r\n this.a = \u0022\u0022;\r\n this.b = \u0022\u0022;\r\n this.c = \u0022\u0022;\r\n this.d = \u0022\u0022;\r\n this.e = \u0022\u0022;\r\n this.f = \u0022\u0022;\r\n this.g = \u0022\u0022;\r\n this.h = \u0022\u0022;\r\n this.i = \u0022\u0022;\r\n makeSpreadable(this);\r\n }\r\n\r\n doA() {}\r\n doB() {}\r\n doC() {}\r\n doD() {}\r\n doE() {}\r\n doF() {}\r\n doG() {}\r\n doH() {}\r\n}\r\n\r\nconst foo = new Foo();\r\nconst bar = {};\r\nfor (const key in foo) {\r\n bar[key] = foo[key];\r\n}","TestCases":[{"Name":"for in","Code":"class Foo {\r\n constructor() {\r\n this.a = \u0022\u0022;\r\n this.b = \u0022\u0022;\r\n this.c = \u0022\u0022;\r\n this.d = \u0022\u0022;\r\n this.e = \u0022\u0022;\r\n this.f = \u0022\u0022;\r\n this.g = \u0022\u0022;\r\n this.h = \u0022\u0022;\r\n this.i = \u0022\u0022;\r\n }\r\n\r\n doA() {}\r\n doB() {}\r\n doC() {}\r\n doD() {}\r\n doE() {}\r\n doF() {}\r\n doG() {}\r\n doH() {}\r\n}\r\n\r\nconst foo = new Foo();\r\nconst bar = {};\r\nfor (const key in foo){\r\n bar[key] = foo[key];\r\n}","IsDeferred":false},{"Name":"spread","Code":"function makeSpreadable(obj) {\r\n const proto = Object.getPrototypeOf(obj);\r\n const methods = Object.getOwnPropertyNames(proto);\r\n for (const method of methods) {\r\n if (method === \u0022constructor\u0022) continue;\r\n obj[method] = proto[method];\r\n }\r\n}\r\n\r\nclass Foo {\r\n constructor() {\r\n this.a = \u0022\u0022;\r\n this.b = \u0022\u0022;\r\n this.c = \u0022\u0022;\r\n this.d = \u0022\u0022;\r\n this.e = \u0022\u0022;\r\n this.f = \u0022\u0022;\r\n this.g = \u0022\u0022;\r\n this.h = \u0022\u0022;\r\n this.i = \u0022\u0022;\r\n makeSpreadable(this);\r\n }\r\n\r\n doA() {}\r\n doB() {}\r\n doC() {}\r\n doD() {}\r\n doE() {}\r\n doF() {}\r\n doG() {}\r\n doH() {}\r\n}\r\n\r\nconst foo = new Foo();\r\nconst bar = {...foo};","IsDeferred":false},{"Name":"for of","Code":"class Foo {\r\n constructor() {\r\n this.a = \u0022\u0022;\r\n this.b = \u0022\u0022;\r\n this.c = \u0022\u0022;\r\n this.d = \u0022\u0022;\r\n this.e = \u0022\u0022;\r\n this.f = \u0022\u0022;\r\n this.g = \u0022\u0022;\r\n this.h = \u0022\u0022;\r\n this.i = \u0022\u0022;\r\n }\r\n\r\n doA() {}\r\n doB() {}\r\n doC() {}\r\n doD() {}\r\n doE() {}\r\n doF() {}\r\n doG() {}\r\n doH() {}\r\n}\r\n\r\nconst foo = new Foo();\r\nconst bar = {};\r\nconst props = Object.getOwnPropertyNames(foo);\r\nconst proto = Object.getPrototypeOf(foo);\r\nconst methods = Object.getOwnPropertyNames(proto);\r\nfor (const key of props){\r\n bar[key] = foo[key];\r\n}\r\nfor (const key of methods){\r\n if (key === \u0022constructor\u0022) continue;\r\n bar[key] = proto[key] \r\n}","IsDeferred":false}]}