alesgenova / post-me

📩 Use web Workers and other Windows through a simple Promise API
https://www.npmjs.com/package/post-me
MIT License
492 stars 13 forks source link

Call methods in the context of the object on which they are defined #60

Closed birtles closed 3 years ago

birtles commented 3 years ago

This allows passing a class instance to implement methods such that the class instance is still able to access class members.

Without this change, the test added in this patch will fail with the following error:

  ● call:bound methods

    TypeError: Cannot read property 'magicNumber' of undefined

Fixes #59.

alesgenova commented 3 years ago

The fix is included in v0.4.5 just released to npm