{"ScriptPreparationCode":null,"TestCases":[{"Name":"Function Prototype","Code":"function Point(x, y){\r\n this.x = x;\r\n this.y = y;\r\n}\r\n\r\nconst pointParent = {\r\n add(point) {\r\n return new Point(this.x \u002B point.x, this.y \u002B point.y);\r\n }\r\n};\r\n\r\nconst pointParentParent = {\r\n sub(point) {\r\n return new Point(this.x \u002B point.x, this.y \u002B point.y);\r\n }\r\n};\r\n\r\nObject.setPrototypeOf(pointParent, pointParentParent);\r\nPoint.prototype = pointParent;\r\n\r\n var p1 = new Point(10, 10);\r\n var p2 = new Point(10, -10);\r\n var sum = p1.add(p2);\r\n var dif = p1.sub(p2);","IsDeferred":false},{"Name":"Object Literal","Code":"const point = (x, y) =\u003E {\r\n return {\r\n x:x,\r\n y:y\r\n }\r\n}\r\n\r\nconst pointParent = {\r\n add(pointc) {\r\n return Object.setPrototypeOf(point(this.x \u002B pointc.x, this.y \u002B pointc.y), pointParent);\r\n }\r\n};\r\n\r\nconst pointParentParent = {\r\n sub(pointc) {\r\n return Object.setPrototypeOf(point(this.x \u002B pointc.x, this.y \u002B pointc.y), pointParent);\r\n }\r\n};\r\n\r\nObject.setPrototypeOf(pointParent, pointParentParent);\r\nvar p1 = Object.setPrototypeOf(point(10,10), pointParent);\r\nvar p2 = Object.setPrototypeOf(point(10,-10), pointParent);\r\n\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false}]}