{"ScriptPreparationCode":"class BaseClass {\r\n constructor() {}\r\n}\r\n\r\nclass Point extends BaseClass {\r\n constructor(x, y) {\r\n super();\r\n this.x = x;\r\n this.y = y;\r\n }\r\n\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 sub(point) {\r\n return new Point(this.x - point.x, this.y - point.y);\r\n }\r\n}\r\nvar Point1 = Point;\r\n\r\nfunction BaseConstructor() {\r\n}\r\n\r\nfunction Point2(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n}\r\n\r\nPoint2.prototype.add = function(point) {\r\n return new Point2(this.x \u002B point.x, this.y \u002B point.y);\r\n}\r\n\r\nPoint2.prototype.sub = function(point) {\r\n return new Point2(this.x - point.x, this.y - point.y);\r\n}\r\n\r\nObject.setPrototypeOf(Object.setPrototypeOf(Point2, BaseConstructor).prototype, BaseConstructor.prototype);\r\n\r\nfunction Point3(x, y) {\r\n return Object.setPrototypeOf({\r\n x,\r\n y,\r\n add: (point) =\u003E Point3(this.x \u002B point.x, this.y \u002B point.y),\r\n sub: (point) =\u003E Point3(this.x - point.x, this.y - point.y)\r\n }, BaseConstructor.prototype);\r\n}","TestCases":[{"Name":"ES6 Class","Code":"var p1 = new Point1(10, 10);\r\nvar p2 = new Point1(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Function Prototype","Code":"var p1 = new Point2(10, 10);\r\nvar p2 = new Point2(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Object Literal","Code":"var p1 = Point3(10, 10);\r\nvar p2 = Point3(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false}]}