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

morebits: Fix bug in getting new token #1143

Merged

Conversation

Amorymeltzer
Copy link
Collaborator

Stems from af13dce/#1038. Looks like, since Morebits.wiki.api.getToken explicitly creates a new construct, this in returnError's return ends up going global (window).

Reported at WT:TW

@Amorymeltzer Amorymeltzer added this to the October 2020 update milestone Oct 5, 2020
@Amorymeltzer Amorymeltzer added bug Module: morebits The morebits.js library labels Oct 5, 2020
@Amorymeltzer
Copy link
Collaborator Author

This should at least partially explain #1119.

@siddharthvp
Copy link
Member

Ohhhhh! Can't believe I did that. I would've preferred .bind(this) but anyway.

Stems from af13dce/wikimedia-gadgets#1038.  Looks like, since `Morebits.wiki.api.getToken` explicitly creates a new construct, `this` in `returnError`'s return ends up going global (`window`).

Reported at WT:TW (https://en.wikipedia.org/w/index.php?oldid=982033312#%22Getting_token%22_and_what?)
@Amorymeltzer
Copy link
Collaborator Author

Fair; done.

@Amorymeltzer Amorymeltzer merged commit b4fbbb9 into wikimedia-gadgets:master Oct 6, 2020
@Amorymeltzer Amorymeltzer deleted the morebits-thistoken branch October 6, 2020 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Module: morebits The morebits.js library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants