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 reference to this in _maybeUnloadDoc inner function #277

Merged
merged 1 commit into from
Mar 20, 2020

Conversation

ericyhwang
Copy link
Contributor

The inner function was introduced in introduced in a320772 (PR #276).

I missed changing a this to model.

I'll look into adding a test later, I want to get this fix out quickly.


This can cause an error like TypeError: Cannot read property '$remote' of undefined in listeners that are checking properties the pass object.

Stack trace will have a snippet like this:

  at Model.emit [as _emit] (events.js:203:15)
  at Model.emit (.../node_modules/racer/lib/Model/events.js:99:10)
  at unloadDoc (.../node_modules/racer/lib/Model/subscriptions.js:197:11)
  at Model._maybeUnloadDoc (.../node_modules/racer/lib/Model/subscriptions.js:186:5)
  at finishUnfetchDoc (.../node_modules/racer/lib/Model/subscriptions.js:127:11)
  at Model.unfetchDoc (.../node_modules/racer/lib/Model/subscriptions.js:122:5)
  at Model._forSubscribable (.../node_modules/racer/lib/Model/subscriptions.js:66:24)
  at Model.unfetch (.../node_modules/racer/lib/Model/subscriptions.js:21:8)

The inner function was introduced in introduced in a320772. I missed a `this`.

This can cause an error like `TypeError: Cannot read property '$remote' of undefined` in listeners that are checking properties the `pass` object.
@ericyhwang ericyhwang merged commit d93c53e into master Mar 20, 2020
@ericyhwang ericyhwang deleted the fix-unload-pass branch March 20, 2020 23:12
@ericyhwang
Copy link
Contributor Author

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

Successfully merging this pull request may close these issues.

1 participant