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

[BUG][CANARY] Mixins throwing object is not extensible #16479

Closed
kiwiupover opened this issue Apr 10, 2018 · 1 comment
Closed

[BUG][CANARY] Mixins throwing object is not extensible #16479

kiwiupover opened this issue Apr 10, 2018 · 1 comment

Comments

@kiwiupover
Copy link
Contributor

kiwiupover commented Apr 10, 2018

Both addon are throwing TypeError: Cannot add property undefined, object is not extensible
https://github.com/offirgolan/ember-cp-validations/blob/master/addon/validations/factory.js#L146
https://github.com/offirgolan/ember-parachute/blob/master/addon/query-params.js#L293

ValidationsMixin[Ember.NAME_KEY] = 'Validations';
Ember.NAME_KEY is undefined
ValidationsMixin seems to be immutable

Addons using Ember.NAME_KEY
https://emberobserver.com/code-search?codeQuery=NAME_KEY&sort=score&sortAscending=false

@kiwiupover kiwiupover changed the title Are mixins immutable [BUG][CANARY] Mixins throwing object is not extensible Apr 10, 2018
@rwjblue
Copy link
Member

rwjblue commented Apr 11, 2018

Steps to fix:

  1. Add this[NAME_KEY] = null; to the Mixin constructor before calling Object.seal(this).
  2. Add a deprecation when accessing Ember.NAME_KEY (suggesting the usage of toString directly).
  3. Profit? 💸

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

No branches or pull requests

2 participants