0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

Merge pull request #1761 from dmitrykurmanov/patch-1

Update error message in the Store
This commit is contained in:
Rich Harris 2018-10-17 11:25:42 -04:00 committed by GitHub
commit 7251a12539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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', () => {