Open tomholub opened 3 years ago
Yes, actually in some other programming languages (C#) when you pass a reference to a method (opgpKey.getEncryptionKey) this reference actually includes this reference for the non-static method (opgpKey). For Javascript, I have to bind opgpKey explicitly so that getEncryptionKey will see it as this. Of course we can bind it via lambda like getEncryptionKey = (params) => opgpKey.getEncryptionKey(params) if you're more comfortable with this programming-style binding.
I thought I have forbidden
.bind
with a linter, but it looks like I didn't. I'll make another issue._Originally posted by @tomholub in https://github.com/FlowCrypt/flowcrypt-browser/pull/3198#discussion_r532873258_