Skip to content

Conversation

@mhegazy
Copy link
Contributor

@mhegazy mhegazy commented Aug 23, 2017

bind log function to avoid invalid access to this.

const discoverTypingsResult = JsTyping.discoverTypings(
this.installTypingHost,
this.log.isEnabled() ? this.log.writeLine : undefined,
this.log.isEnabled() ? this.log.writeLine.bind(this.log) : undefined,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use line => this.log.writeLine(line) instead of .bind? AFAIK we'd avoided using bind in most places, why stop now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we avoided bind.. why.

@weswigham
Copy link
Member

Does this need to be PR'd into master, too?

@mhegazy mhegazy merged commit 1420fbc into release-2.5 Aug 23, 2017
@mhegazy mhegazy deleted the bindLogFunction branch August 23, 2017 19:35
mhegazy added a commit that referenced this pull request Aug 23, 2017
* Bind logger function before using

* Use lambda isntead of bind
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants