fix(change_detector): ensure that locals are only used when implicit receiver
closes #1542
This commit is contained in:

committed by
Misko Hevery

parent
5b104936ae
commit
d4925b61ff
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user