Skip to content

Commit

Permalink
Merge pull request #1761 from dmitrykurmanov/patch-1
Browse files Browse the repository at this point in the history
Update error message in the Store
  • Loading branch information
Rich-Harris authored Oct 17, 2018
2 parents cbfcde3 + ebc7eeb commit 7251a12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion store.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ assign(Store.prototype, {
let dirty = false;

for (const key in newState) {
if (this._computed[key]) throw new Error(`'${key}' is a read-only property`);
if (this._computed[key]) throw new Error(`'${key}' is a read-only computed property`);
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
Expand Down
2 changes: 1 addition & 1 deletion test/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('store', () => {

assert.throws(() => {
store.set({ bar: 'whatever' });
}, /'bar' is a read-only property/);
}, /'bar' is a read-only computed property/);
});

it('allows multiple dependents to depend on the same computed property', () => {
Expand Down

0 comments on commit 7251a12

Please sign in to comment.