Cannot read value of property defined with "get" AND "set" methods #1648

Closed
akagomez opened this Issue Apr 28, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@akagomez
Contributor

akagomez commented Apr 28, 2015

Demo:
http://jsfiddle.net/akagomez/deagovbn/

Problem 1:
Calling map.attr('foo') does not return the correct value.

Problem 2:
foo's get method is passed the wrong lastSetVal after being map.attr('foo') is called.

Problem 3:
When foo is bound to, the get method doesn't get called at all.

I created a test that demonstrates the issue here: 369ff13

/cc @daffl @justinbmeyer

@kylegifford

This comment has been minimized.

Show comment
Hide comment
@kylegifford

kylegifford Apr 29, 2015

Contributor

Looks like this is an issue with set not saving correctly. If I modify set to the following in the demo, it works:

set: function (newVal, setVal) {
    console.log('set:', newVal);
    setVal(newVal);
    return newVal; 
}
Contributor

kylegifford commented Apr 29, 2015

Looks like this is an issue with set not saving correctly. If I modify set to the following in the demo, it works:

set: function (newVal, setVal) {
    console.log('set:', newVal);
    setVal(newVal);
    return newVal; 
}
@akagomez

This comment has been minimized.

Show comment
Hide comment
@akagomez

akagomez Apr 29, 2015

Contributor

@kylegifford setVal is meant for async setting. I don't think that truly addresses the issue.

Contributor

akagomez commented Apr 29, 2015

@kylegifford setVal is meant for async setting. I don't think that truly addresses the issue.

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