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

Overwriting a getter from a mixin calls the original getter #18829

Closed
boris-petrov opened this issue Mar 20, 2020 · 2 comments
Closed

Overwriting a getter from a mixin calls the original getter #18829

boris-petrov opened this issue Mar 20, 2020 · 2 comments

Comments

@boris-petrov
Copy link
Contributor

Ember 3.16.3.

import EmberObject from '@ember/object';
import Mixin from '@ember/object/mixin';

class Model extends EmberObject {
  get bar() {
    console.log('bar');
  }
}
Object.defineProperty(Model.prototype, 'foo', {
  get() {
    console.log('foo');
  },
});

const mixin = Mixin.create({
  get foo() {
  },
  get bar() {
  },
});
const NewModel = Model.extend(mixin);

NewModel.create();

Both foo and bar are printed in the console when this code executes. They both shouldn't.

cc @pzuraq

@lifeart
Copy link
Contributor

lifeart commented Apr 4, 2020

I think issue from

let propValue = value[prop];

@boris-petrov
Copy link
Contributor Author

I believe this issue has been resolved (I believe as of Ember 4.12). Thanks!

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

No branches or pull requests

2 participants