Skip to content

Commit cc63fcb

Browse files
author
Scott J. Miles
committed
use new Path api (see Polymer#267)
1 parent 2f7c655 commit cc63fcb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/instance/properties.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,16 @@
7878
// bind a property in A to a path in B by converting A[property] to a
7979
// getter/setter pair that accesses B[...path...]
8080
function bindProperties(inA, inProperty, inB, inPath) {
81-
log.bind && console.log(LOG_BIND_PROPS, inB.localName || 'object', inPath, inA.localName, inProperty);
81+
log.bind && console.log(LOG_BIND_PROPS, inB.localName || 'object',
82+
inPath, inA.localName, inProperty);
8283
// capture A's value if B's value is null or undefined,
8384
// otherwise use B's value
84-
var v = PathObserver.getValueAtPath(inB, inPath);
85+
var path = Path.get(inPath);
86+
var v = path.getValueFrom(inB);
8587
if (v === null || v === undefined) {
86-
PathObserver.setValueAtPath(inB, inPath, inA[inProperty]);
88+
path.setValueFrom(inB, inA[inProperty]);
8789
}
88-
return PathObserver.defineProperty(inA, inProperty,
90+
return PathObserver.defineProperty(inA, inProperty,
8991
{object: inB, path: inPath});
9092
}
9193

0 commit comments

Comments
 (0)