{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/ember.js/issues/11831","labels_url":"https://api.github.com/repos/emberjs/ember.js/issues/11831/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/ember.js/issues/11831/comments","events_url":"https://api.github.com/repos/emberjs/ember.js/issues/11831/events","html_url":"https://github.com/emberjs/ember.js/issues/11831","id":96173674,"number":11831,"title":"Computed properties new getter/setter in mixin don't access inheritor's properties properly","user":{"login":"justin-hackin","id":4888331,"avatar_url":"https://avatars.githubusercontent.com/u/4888331?v=3","gravatar_id":"","url":"https://api.github.com/users/justin-hackin","html_url":"https://github.com/justin-hackin","followers_url":"https://api.github.com/users/justin-hackin/followers","following_url":"https://api.github.com/users/justin-hackin/following{/other_user}","gists_url":"https://api.github.com/users/justin-hackin/gists{/gist_id}","starred_url":"https://api.github.com/users/justin-hackin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justin-hackin/subscriptions","organizations_url":"https://api.github.com/users/justin-hackin/orgs","repos_url":"https://api.github.com/users/justin-hackin/repos","events_url":"https://api.github.com/users/justin-hackin/events{/privacy}","received_events_url":"https://api.github.com/users/justin-hackin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-20T22:09:52Z","updated_at":"2015-07-20T22:29:42Z","closed_at":null,"body":"I have some particularly unusual computed properties in a mixin that alter the target property based upon another property.  My code works fine with the old syntax as such\r\n\r\n```\r\nregionTop: Ember.computed((key, value, previousValue) ->   \r\n    target = if @.get('isScaleComponent') \r\n    then 'assetCmp.regionModel.scaleTop'\r\n    else  'regionModel.top'\r\n    if arguments.length > 1\r\n      @.set(target, value)\r\n    @.get(target)\r\n  ).property('isScaleComponent','assetCmp.regionModel.scaleTop','regionModel.top')\r\n\r\n  regionLeft: Ember.computed((key, value, previousValue) -> \r\n    target = if @.get('isScaleComponent') \r\n    then 'assetCmp.regionModel.scaleLeft'\r\n    else 'regionModel.left'\r\n    if arguments.length > 1\r\n      @.set(target, value)\r\n    return @.get(target)\r\n  ).property('isScaleComponent','assetCmp.regionModel.scaleLeft','regionModel.left')\r\n```\r\n\r\nI have changed them to the following \r\n```\r\nregionTop: Ember.computed('isScaleComponent','assetCmp.regionModel.scaleTop','regionModel.top',\r\n    set:(key, value)->\r\n      prop = if @.get('isScaleComponent') then 'assetCmp.regionModel.scaleTop' else  'regionModel.top'\r\n      @.set(prop, value)\r\n    get: ->\r\n      prop = if @.get('isScaleComponent') then 'assetCmp.regionModel.scaleTop' else  'regionModel.top'\r\n      @.get(prop)\r\n  )\r\n\r\n  regionLeft: Ember.computed('isScaleComponent','assetCmp.regionModel.scaleLeft','regionModel.left',\r\n    set: (key, value)->\r\n      prop = if @.get('isScaleComponent') then 'assetCmp.regionModel.scaleLeft' else 'regionModel.left'\r\n      @.set(prop, value)\r\n    get:->\r\n      prop = if @.get('isScaleComponent') then 'assetCmp.regionModel.scaleLeft' else 'regionModel.left'\r\n      @.get(prop)\r\n  )\r\n```\r\n\r\nisScaleComponent is a property of the inheriting component.  What I noticed is that @.get('isScaleComponent') is different in the getter than in the setter (it appears to correct on the set and to be wrong on the get, as if its pointing to another component) .  \r\n\r\nI am having a hard time debugging further as 'this' in the context of the component mixin is not the component itself which is what may be causing this issue.  I'm sorry I can't reproduce this, I can't find a working fiddle/bin example to work from.\r\n"},"comment":{"url":"https://api.github.com/repos/emberjs/ember.js/issues/comments/123073228","html_url":"https://github.com/emberjs/ember.js/issues/11831#issuecomment-123073228","issue_url":"https://api.github.com/repos/emberjs/ember.js/issues/11831","id":123073228,"user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T22:29:42Z","updated_at":"2015-07-20T22:29:42Z","body":"the code looks functionality different\r\n\r\n```coffee\r\n    if arguments.length > 1\r\n      @.set(target, value)\r\n    @.get(target)\r\n```\r\n\r\nvs\r\n\r\n```coffee\r\n    set:(key, value)->\r\n      prop = if @.get('isScaleComponent') then 'assetCmp.regionModel.scaleTop' else  'regionModel.top'\r\n      @.set(prop, value)\r\n```\r\n\r\nthe return values in setters do matter, be sure to port from one form to the other, while maintaining the same return values.."}}