{"ScriptPreparationCode":"var Point1 = class Point1 {\r\n\tconstructor(x, y){\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n }\r\n\r\n\tadd(point){\r\n\t\treturn new Point1(this.x \u002B point.x, this.y \u002B point.y);\r\n }\r\n\r\n\tsub(point){\r\n\t\treturn new Point1(this.x - point.x, this.y - point.y);\r\n }\r\n}\r\n\r\nvar Point1b = class Point1b extends Point1 {\r\n\taddb(point){\r\n\t\treturn new Point1b(this.x \u002B point.x, this.y \u002B point.y);\r\n }\r\n\r\n\tsubb(point){\r\n\t\treturn new Point1b(this.x - point.x, this.y - point.y);\r\n }\r\n}\r\n\r\nfunction Point2(x, y) {\r\n\tthis.x = x;\r\n\tthis.y = y;\r\n}\r\n\r\nPoint2.prototype.add = function add(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 sub(point){\r\n\treturn new Point2(this.x - point.x, this.y - point.y);\r\n}\r\n\r\nfunction Point2b(x, y) {\r\n\tPoint2.call(this, x, y);\r\n}\r\nPoint2b.prototype = Object.create(Point2.prototype);\r\nPoint2b.prototype.constructor = Point2b;\r\n\r\nPoint2b.prototype.addb = function addb(point){\r\n return new Point2b(this.x \u002B point.x, this.y \u002B point.y);\r\n}\r\n\r\nPoint2b.prototype.subb = function subb(point){\r\n\treturn new Point2b(this.x - point.x, this.y - point.y);\r\n}\r\n\r\nconst add = (x,y) =\u003E function add(point){\r\n return Point3(x \u002B point.x, y \u002B point.y);\r\n}\r\n\r\nconst sub = (x,y) =\u003E function sub(point){\r\n\treturn Point3(x - point.x, y - point.y);\r\n}\r\n\r\nfunction Point3(x, y){\r\n\treturn {\r\n \tx, \r\n \ty, \r\n add: add(x,y),\r\n sub: sub(x,y)\r\n } \r\n}\r\n\r\nconst addb = (x,y) =\u003E function addb(point){\r\n return Point3b(x \u002B point.x, y \u002B point.y);\r\n}\r\n\r\nconst subb = (x,y) =\u003E function subb(point){\r\n\treturn Point3b(x - point.x, y - point.y);\r\n}\r\n\r\nfunction Point3b(x, y){\r\n\treturn {\r\n \t__proto__: new Point3(x, y),\r\n addb: addb(x,y),\r\n subb: subb(x,y)\r\n } \r\n}\r\n\r\nfunction Point4(x, y){\r\n\treturn {\r\n \tx, \r\n \ty,\r\n \tadd: (point)=\u003EPoint4(x \u002B point.x, y \u002B point.y),\r\n\t \tsub: (point)=\u003EPoint4(x - point.x, y - point.y)\r\n } \r\n}\r\n\r\nfunction Point4b(x, y){\r\n\treturn {\r\n \t__proto__: Point4(x, y),\r\n \taddb: (point)=\u003EPoint4b(x \u002B point.x, y \u002B point.y),\r\n\t \tsubb: (point)=\u003EPoint4b(x - point.x, y - point.y)\r\n } \r\n}\r\n\r\nconst point5common = (x, y) =\u003E ({\r\n \tadd(point){\r\n \treturn Point5(x \u002B point.x, y \u002B point.y);\r\n\t},\r\n \tsub(point){\r\n\t\treturn Point5(x - point.x, y - point.y);\r\n\t}\r\n});\r\n\r\nfunction Point5(x, y) {\r\n\treturn {\r\n\t\tx,\r\n \ty,\r\n \t...point5common(x,y)\r\n }\r\n}\r\n\r\nconst point5bcommon = (x,y) =\u003E ({\r\n \taddb(point){\r\n \treturn Point5b(x \u002B point.x, y \u002B point.y);\r\n\t},\r\n \tsubb(point){\r\n\t\treturn Point5b(x - point.x, y - point.y);\r\n\t}\r\n});\r\n\r\nfunction Point5b(x, y) {\r\n\treturn {\r\n\t\t...Point5(x,y),\r\n \t...point5bcommon(x,y)\r\n }\r\n}\r\n\r\nvar Point6 = class Point6 {\r\n\tconstructor(x, y){\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n }\r\n}\r\n\r\nPoint6.prototype.add = function add(point){\r\n\treturn new Point6(this.x \u002B point.x, this.y \u002B point.y);\r\n}\r\nPoint6.prototype.sub = function sub(point){\r\n\treturn new Point6(this.x - point.x, this.y - point.y);\r\n}\r\n\r\nvar Point6b = class Point6b extends Point6 {}\r\n\r\nPoint6b.prototype.addb = function addb(point){\r\n\treturn new Point6b(this.x \u002B point.x, this.y \u002B point.y);\r\n}\r\nPoint6b.prototype.subb = function subb(point){\r\n\treturn new Point6b(this.x - point.x, this.y - point.y);\r\n}\r\n\r\nconst basePropertyDescriptor = {\r\n configurable: true,\r\n enumerable: false,\r\n writable: true,\r\n}\r\n\r\nvar Point7 = class Point7 {\r\n\tconstructor(x, y){\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n }\r\n}\r\n\r\nObject.defineProperties(Point7.prototype, {\r\n\tadd: { ...basePropertyDescriptor, value: function add(point){\r\n\t\treturn new Point7(this.x \u002B point.x, this.y \u002B point.y);\r\n\t}},\r\n\tsub: { ...basePropertyDescriptor, value: function sub(point){\r\n\t\treturn new Point7(this.x - point.x, this.y - point.y);\r\n\t}}\r\n});\r\n\r\nvar Point7b = class Point7b extends Point7 {}\r\n\r\nObject.defineProperties(Point7b.prototype, {\r\n\taddb: { ...basePropertyDescriptor, value: function addb(point){\r\n\t\treturn new Point7b(this.x \u002B point.x, this.y \u002B point.y);\r\n\t}},\r\n\tsubb: { ...basePropertyDescriptor, value: function subb(point){\r\n\t\treturn new Point7b(this.x - point.x, this.y - point.y);\r\n\t}}\r\n});\r\n\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},{"Name":"ES6 Class (inheritance)","Code":"var p1 = new Point1b(10, 10);\r\nvar p2 = new Point1b(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Function Prototype (inheritance)","Code":"var p1 = new Point2b(10, 10);\r\nvar p2 = new Point2b(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Object Literal (inheritance)","Code":"var p1 = Point3b(10, 10);\r\nvar p2 = Point3b(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Inline Object Literal","Code":"var p1 = Point4(10, 10);\r\nvar p2 = Point4(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Inline Object Literal (inheritance)","Code":"var p1 = Point4b(10, 10);\r\nvar p2 = Point4b(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Spread Object Literal","Code":"var p1 = Point5(10, 10);\r\nvar p2 = Point5(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Spread Object Literal (inheritance)","Code":"var p1 = Point5b(10, 10);\r\nvar p2 = Point5b(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Modified ES6 Class","Code":"var p1 = new Point6(10, 10);\r\nvar p2 = new Point6(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Modified ES6 Class (inheritance)","Code":"var p1 = new Point6b(10, 10);\r\nvar p2 = new Point6b(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Modified Properties ES6 Class","Code":"var p1 = new Point7(10, 10);\r\nvar p2 = new Point7(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Modified Properties ES6 Class (inheritance)","Code":"var p1 = new Point7b(10, 10);\r\nvar p2 = new Point7b(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false}]}