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

[BUGFIX beta] Remove access to this in HTMLBars helpers. #10554

Merged
merged 1 commit into from
Mar 1, 2015

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Mar 1, 2015

The value of this in a helper has changed at least twice (likely more). This updates the HTMLBars hooks to call each helper with an undefined context. The main purpose of this is to pave the way for another refactoring of the view + helper layer that uses this for a different purpose.

To fix any usages of this in a helper, you can access the view from env.data.view instead.

The value of `this` in a helper has changed at least twice (likely
more). This updates the HTMLBars hooks to call each helper with an
`undefined` context. The main purpose of this is to pave the way for
another refactoring of the view + helper layer that uses `this` for a
different purpose.

To fix any usages of `this` in a helper, you can access the `view` from
`env.data.view` instead.
rwjblue added a commit that referenced this pull request Mar 1, 2015
[BUGFIX beta] Remove access to `this` in HTMLBars helpers.
@rwjblue rwjblue merged commit 3c0daea into emberjs:master Mar 1, 2015
@rwjblue rwjblue deleted the undefined-this-in-helpers branch March 1, 2015 06:06
rlivsey added a commit to rlivsey/ember-intl that referenced this pull request Mar 1, 2015
Uses `env.data.view` to get the container, which has been available 
since 1.10.0-beta.1, so this is safe for all HTMLBars Ember versions.

See emberjs/ember.js#10554 for context
@pixelhandler
Copy link
Contributor

@rwjblue this seems related #10812 correct?

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.

2 participants