Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Commit fe4b09b

Browse files
committed
make path public on PathObserver and change third argument from path to the PathObserver instance
[email protected], jmesserly BUG= Review URL: https://codereview.appspot.com/99660045
1 parent 4905f0b commit fe4b09b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/observe.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,10 @@
10041004
PathObserver.prototype = createObject({
10051005
__proto__: Observer.prototype,
10061006

1007+
get path() {
1008+
return this.path_;
1009+
},
1010+
10071011
connect_: function() {
10081012
if (hasObserve)
10091013
this.directObserver_ = getObservedSet(this, this.object_);
@@ -1030,7 +1034,7 @@
10301034
if (skipChanges || areSameValue(this.value_, oldValue))
10311035
return false;
10321036

1033-
this.report_([this.value_, oldValue, this.path_]);
1037+
this.report_([this.value_, oldValue, this]);
10341038
return true;
10351039
},
10361040

tests/test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ suite('PathObserver Tests', function() {
469469
assert.strictEqual(args.length, 3);
470470
assert.strictEqual(args[0], 'baz');
471471
assert.strictEqual(args[1], 'bar');
472-
assert.strictEqual(args[2], path);
472+
assert.strictEqual(args[2], observer);
473+
assert.strictEqual(args[2].path, path);
473474
observer.close();
474475
});
475476

0 commit comments

Comments
 (0)