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

Commit

Permalink
make path public on PathObserver and change third argument from path …
Browse files Browse the repository at this point in the history
…to the PathObserver instance

[email protected], jmesserly
BUG=

Review URL: https://codereview.appspot.com/99660045
  • Loading branch information
rafaelw committed May 29, 2014
1 parent 4905f0b commit fe4b09b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/observe.js
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,10 @@
PathObserver.prototype = createObject({
__proto__: Observer.prototype,

get path() {
return this.path_;
},

connect_: function() {
if (hasObserve)
this.directObserver_ = getObservedSet(this, this.object_);
Expand All @@ -1030,7 +1034,7 @@
if (skipChanges || areSameValue(this.value_, oldValue))
return false;

this.report_([this.value_, oldValue, this.path_]);
this.report_([this.value_, oldValue, this]);
return true;
},

Expand Down
3 changes: 2 additions & 1 deletion tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ suite('PathObserver Tests', function() {
assert.strictEqual(args.length, 3);
assert.strictEqual(args[0], 'baz');
assert.strictEqual(args[1], 'bar');
assert.strictEqual(args[2], path);
assert.strictEqual(args[2], observer);
assert.strictEqual(args[2].path, path);
observer.close();
});

Expand Down

0 comments on commit fe4b09b

Please sign in to comment.