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

Set 'this' context properly in FuncEventSource #3848

Merged
merged 1 commit into from Oct 6, 2017

Conversation

declspec
Copy link
Contributor

@declspec declspec commented Sep 26, 2017

The current code sets the this context when invoking the user-defined event source function. However it uses this.calendar, which is undefined in the Promise callback. It should be using _this to access the correct calendar object.

The default implementation is a fairly innocuous bug and won't cause any issues unless the caller tries to use this in their event source function. However, if you're in use strict mode (i.e. you've included fullcalendar as part of a build-chain) the browser will throw errors and stop execution.

https://jsbin.com/sepeparuse/edit?html,js,console,output

The current code sets the `this` context when invoking the user-defined event source function. However it uses `this.calendar`, which is undefined in the `Promise` callback. It should be using `_this` to access the correct context.
@arshaw
Copy link
Member

arshaw commented Sep 26, 2017

thanks

@arshaw arshaw merged commit 7e507d3 into fullcalendar:master Oct 6, 2017
@arshaw
Copy link
Member

arshaw commented Oct 11, 2017

released in 3.6.0

@declspec
Copy link
Contributor Author

Awesome, cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants