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:
commit
7251a12539
2
store.js
2
store.js
@ -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;
|
||||
|
@ -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', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user