2025-04-23
Sometimes it his quite handy to be able to catch code assigning to an object or reading from an object property.
This small piece of code can do it. Google MDN Proxy for more details.
this.root = new Proxy(new DirEntry(""), {
get(target, prop, receiver) {
debugger
return Reflect.get(...arguments);
},
set(target, prop, receiver) {
debugger
return Reflect.set(...arguments);
}
})