setTimeout(function tick() {
var value = 0;
setInterval(function tock() {
console.log(value);
});
});
Changing the value here, will have no effect as the capture has already happened.
A possible workaround for this, is to give every block a binding object, in which the generated code would behave similar to how function proxies work with a global backing object.
The generated code would look something like the following:
Take the following example:
Changing the value here, will have no effect as the capture has already happened.
A possible workaround for this, is to give every block a
binding
object, in which the generated code would behave similar to how function proxies work with a global backing object.The generated code would look something like the following:
This way, we can also lazily set properties on it at runtime while traversing the tree, lets say an assignment operator.