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 release] Ensure _actions specified to extend works. #12188

Merged
merged 1 commit into from
Aug 24, 2015

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Aug 24, 2015

The initial deprecation of _actions and moving it to actions was a bit too naive. The deprecateProperty helper was used, which meant that when _actions was set, it would call set(this, 'actions', newValue). This meant that passing _actions to Ember.Route.extend (or .reopen) resulted in the _actions completely clobbering actions (and loosing any previously defined actions there).

The fix was to:

  • Replace the generic deprecateProperty usage with a custom Object.defineProperty call, that defines a setter with an assertion instead of clobbering.
  • Implementing a willMergeMixin that mutates the props at extend time (to ensure that _actions is moved to actions with a deprecation).

Fixes #12081.

Thanks to @kimroen for helping track this down.

The initial deprecation of `_actions` and moving it to `actions` was a
bit too naive. The `deprecateProperty` helper was used, which meant that
when `_actions` was set, it would call `set(this, 'actions', newValue)`.
This meant that passing `_actions` to `Ember.Route.extend` (or
`.reopen`) resulted in the `_actions` completely clobbering `actions`
(and loosing any previously defined actions there).

The fix was to:

* Replace the generic `deprecateProperty` usage with a custom
 `Object.defineProperty` call, that defines a setter with an assertion
 instead of clobbering.
* Implementing a `willMergeMixin` that mutates the `props` at extend
  time (to ensure that `_actions` is moved to `actions` with a
  deprecation).
rwjblue added a commit that referenced this pull request Aug 24, 2015
[BUGFIX release] Ensure `_actions` specified to extend works.
@rwjblue rwjblue merged commit c2c1079 into emberjs:master Aug 24, 2015
@rwjblue rwjblue deleted the prevent-issue-with-_actions branch August 24, 2015 01:08
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.

Broken query params in ember 2.0.0
1 participant