Skip to content

Commit

Permalink
Merge branch 'master' of github.com:knockout/knockout
Browse files Browse the repository at this point in the history
  • Loading branch information
mbest committed Oct 4, 2017
2 parents 0003397 + f916d57 commit d7fc725
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/asyncBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ describe('Rate-limited', function() {
jasmine.Clock.tick(250);
expect(notifySpy).toHaveBeenCalledWith('b');
});

it('Should return "[object Object]" with .toString', function() {
// Issue #2252: make sure .toString method does not throw error
expect(new ko.subscribable().toString()).toBe('[object Object]')
});
});

describe('Observable', function() {
Expand Down
4 changes: 4 additions & 0 deletions src/subscribables/subscribable.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ var ko_subscribable_fn = {
return !this['equalityComparer'] || !this['equalityComparer'](oldValue, newValue);
},

toString: function() {
return '[object Object]'
},

extend: applyExtenders
};

Expand Down

0 comments on commit d7fc725

Please sign in to comment.