En el siguiente código, ¿cómo es posible que la variable temp siga viva después de que finalice la llamada a Decorate ?
function Decorate(target, key) { let temp = target[key]; Object.defineProperty(target, key, { get: function() { console.log('getter executed'); return temp; }, set: function(newValue) { console.log('setter executed'); temp = newValue; } }); } class Test { x; constructor() {} }; let t = new Test(); Decorate(t, 'x'); //first and only decorator call after which the variable temp should be dead tx = 123; //setter sets x to 123, obviously it somehow still uses temp tx = 256; //second setter call sets x to 256, temp still somehow alive tx = 357; //etc.