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

Fix references to undefined this #1535

Merged
merged 1 commit into from
Sep 17, 2017
Merged

Fix references to undefined this #1535

merged 1 commit into from
Sep 17, 2017

Conversation

astorije
Copy link
Member

79eb83d introduces a couple uses of this in a function that doesn't know about the channel.

I preferred to pass the channel instead of making this part of the prototype (and therefore exporting it) but I can switch to that otherwise.

@astorije astorije added the Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. label Sep 17, 2017
@astorije astorije added this to the 2.5.0 milestone Sep 17, 2017
@astorije astorije requested a review from xPaw September 17, 2017 05:12
@xPaw
Copy link
Member

xPaw commented Sep 17, 2017

@astorije I think prototype is better suited here (think private function in a class). Also, oops.

@astorije
Copy link
Member Author

think private function in a class

What do you mean, I don't think it's possible to have a private member, is it?

@xPaw
Copy link
Member

xPaw commented Sep 17, 2017

It is possible in an actual class, I just suggested that prototype is better here than passing references in the same file.

@astorije
Copy link
Member Author

Actually, nothing .call() can't fix 😁
That way, still private, can still use this. What do you think?

It looks like private methods are an ES7 thing, and just not very pretty syntactic sugar over .call (same code, just this::writeUserLog(client, msg)).

@astorije astorije merged commit 4f38bc9 into master Sep 17, 2017
@astorije astorije deleted the astorije/fix-master branch September 17, 2017 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants