{"ScriptPreparationCode":"fun = function(a) {\r\n return a * 2\r\n}\r\nproxyWithApply = new Proxy(fun, {\r\n apply(target, thisArg, argArray) {\r\n return target.apply(thisArg, argArray)\r\n }\r\n})\r\nproxyWithReflect = new Proxy(fun, {\r\n apply(target, thisArg, argArray) {\r\n return Reflect.apply(target, thisArg, argArray)\r\n }\r\n})\r\n\r\nobj = {\r\n calc: fun\r\n}\r\nobjWithPatch = {\r\n calc: proxyWithApply\r\n}\r\nobjWithProxy = new Proxy(obj, {\r\n get(target, prop, receiver) {\r\n if (prop === \u0027calc\u0027) {\r\n return new Proxy(fun, {\r\n apply(target, thisArg, argArray) {\r\n return Reflect.apply(target, thisArg, argArray)\r\n }\r\n })\r\n } else {\r\n return Reflect.get(target, prop, receiver)\r\n }\r\n }\r\n})","TestCases":[{"Name":"Function invocation","Code":"fun(10)","IsDeferred":false},{"Name":"Proxy with apply","Code":"proxyWithApply(10)","IsDeferred":false},{"Name":"Proxy with Reflect","Code":"proxyWithReflect(10)","IsDeferred":false},{"Name":"Object method","Code":"obj.calc(10)","IsDeferred":false},{"Name":"Object With Patched emthod","Code":"objWithPatch.calc(10)","IsDeferred":false},{"Name":"Object with proxy proxy","Code":"objWithProxy.calc(10)","IsDeferred":false}]}