{"ScriptPreparationCode":"class Holder {\r\n constructor(init) {\r\n Holder.internalAssign(this, init);\r\n }\r\n static has(instance, property) {\r\n return Object.prototype.hasOwnProperty.call(instance, property);\r\n }\r\n static internalAssign(target, source) {\r\n if (Holder.has(source, \u0022a\u0022))\r\n target.a = source.a;\r\n if (Holder.has(source, \u0022b\u0022))\r\n target.b = source.b;\r\n if (Holder.has(source, \u0022c\u0022))\r\n target.c = source.c;\r\n }\r\n clone() {\r\n return new Holder(this);\r\n }\r\n\r\n cloneWith(props) {\r\n const cloned = this.clone();\r\n Holder.internalAssign(cloned, props);\r\n return cloned;\r\n }\r\n cloneWith2(props) {\r\n const cloned = this.clone();\r\n Object.assign(this, props);\r\n return cloned;\r\n }\r\n\r\n mutate(mutation) {\r\n const cloned = this.clone();\r\n mutation(cloned);\r\n return cloned;\r\n }\r\n}\r\n\r\nvar initHolder = new Holder({\r\n a: \u0022value of a\u0022,\r\n b: \u0022value of b\u0022,\r\n c: 1\r\n});","TestCases":[{"Name":"cloneWith","Code":"initHolder.cloneWith({ a: \u0022changed a\u0022, b: \u0022changed b\u0022 });","IsDeferred":false},{"Name":"cloneWith2","Code":"initHolder.cloneWith2({ a: \u0022changed a\u0022, b: \u0022changed b\u0022 });","IsDeferred":false},{"Name":"mutate","Code":"initHolder.mutate(x =\u003E { x.a = \u0022changed a\u0022; x.b = \u0022changed b\u0022 });","IsDeferred":false}]}