Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for the scope parameter in the MessageHandler.on method #11110

Merged
merged 1 commit into from Sep 1, 2019

Commits on Sep 1, 2019

  1. Remove support for the scope parameter in the MessageHandler.on m…

    …ethod
    
    At this point in time it's easy to convert the `MessageHandler.on` call-sites to use arrow functions, and thus let the JavaScript engine handle scopes for us, rather than having to manually keep references to the relevant scopes in `MessageHandler`.[1]
    An additional benefit of this is that a couple of `Function.prototype.call()` instances can now be converted into "normal" function calls, which should be a tiny bit more efficient.
    
    All in all, I don't see any compelling reason why it'd be necessary to keep supporting custom `scope`s in the `MessageHandler` implementation.
    
    ---
    [1] In the event that a custom scope is ever needed, simply using `bind` on the handler function when calling `MessageHandler.on` ought to work as well.
    Snuffleupagus committed Sep 1, 2019
    Copy the full SHA
    055f039 View commit details
    Browse the repository at this point in the history