My target object is Notification.prototype and I need to proxy the Object.getOwnPropertyDescriptor() calls to it. I'm unable decide where to assign my proxy into.
Notification.prototype
Object.getOwnPropertyDescriptor()
var myProxy = new Proxy(obj, { get: function(target, key) { console.log("GET CALLED"); return target[key]; }, ownKeys: function() { console.log("Own Keys called"); return ["a", "b"]; }, getOwnPropertyDescriptor: function(target, key) { console.log("Property Descriptor Called"); return { value: this.get(target, key), enumerable: true, configurable: true }; } });
1.4m articles
1.4m replys
5 comments
57.0k users