fix(change_detector): ensure that locals are only used when implicit receiver

closes #1542
This commit is contained in:
Matteo Suppo
2015-04-28 13:14:53 +02:00
committed by Misko Hevery
parent 5b104936ae
commit d4925b61ff
2 changed files with 17 additions and 3 deletions

View File

@ -469,6 +469,18 @@ export function main() {
expect(executeWatch('name', 'name', new Person("Jim"), locals))
.toEqual(['name=Jim']);
});
it('should correctly handle nested properties', () => {
var address = new Address('Grenoble');
var person = new Person('Victor', address);
var locals = new Locals(null,
MapWrapper.createFromPairs([['city', 'MTV']]));
expect(executeWatch('address.city', 'address.city', person, locals))
.toEqual(['address.city=Grenoble']);
expect(executeWatch('city', 'city', person, locals))
.toEqual(['city=MTV']);
});
});
describe("handle children", () => {
@ -953,4 +965,4 @@ class TestDispatcher extends ChangeDispatcher {
_asString(value) {
return (isBlank(value) ? 'null' : value.toString());
}
}
}