lab15: init

This commit is contained in:
2026-04-16 16:15:22 -07:00
parent c021b2e24e
commit aec8289f11
3 changed files with 154 additions and 0 deletions

21
lab15/tracing.js Normal file
View File

@@ -0,0 +1,21 @@
let obj = { foo: 'bar' };
let o = new Proxy(obj, {
set: (target, name, val) => {
console.log(`Setting ${name} to ${val}`);
//target[name] = val;
//return true;
//return Reflect.set(target,name,val);
return Reflect.set(...arguments);
},
get: (target, name) => {
console.log(`Getting ${name}`);
return Reflect.get(...arguments);
}
});
o.foo = "fighters";
let ff = "foo" + o.foo;