Implement support for `$this` in closure