You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classMessenger{message="Hello, world!";sayHi(){print(this.message);}}constmessenger=newMessenger();messenger.sayHi();// This works fine.const{ sayHi }=messenger;sayHi();// Issue arises here.
A more realistic case where one might encounter would likely involve destructuring in callback parameters, which is where I found encountered this issue.
Alternatively: Destructing a class method causes it to lose it's sense of self ;)
I'm not entirely sure how one would go about fixing this, but I'd figure I may as well report it instead of letting it go undocumented.
One potential way might be to simply pass the
_binding
with all invocations.Or treat it as an alias during compilation, not creating a separate variable.
Input:
A more realistic case where one might encounter would likely involve destructuring in callback parameters, which is where I found encountered this issue.
Output:
Error:
The text was updated successfully, but these errors were encountered: