Open jakearchibald opened 2 years ago
I'd be ok having implicit "this" capture only when one is within the same algorithm basically. But if for example in that example, 2.1 was a link to an algorithm elsewhere, "this" shouldn't be useable there, since that would be just hard to read. Reader would effectively have to go up the stack trace to see what "this" is.
Would it prevent GC?
Depends how smart we expect prose to be.
Thinking in JS terms, the queued steps would be GC'd once they'd executed. Therefore things they reference, like [=this=], would no longer be valid references.
https://webidl.spec.whatwg.org/#this
It isn't clear how nested steps behave in relation to
this
.It feels like WebIDL could explicitly allow the above, by saying
this
gets its value from the 'closest' constructor steps, getter steps, setter steps, or method steps.