From f739b4772a4ad32c0fd337afb9d5594ebd776073 Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Tue, 7 Jul 2020 23:23:00 +0800 Subject: [PATCH] error on expression scope store (#5079) --- CHANGELOG.md | 1 + src/compiler/compile/Component.ts | 15 ++++++++++++--- src/compiler/compile/nodes/shared/Expression.ts | 13 ++++++++----- .../runtime/samples/store-shadow-scope/_config.js | 3 +++ .../samples/store-shadow-scope/main.svelte | 9 +++++++++ .../store-template-expression-scope/_config.js | 3 +++ .../store-template-expression-scope/main.svelte | 9 +++++++++ 7 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 test/runtime/samples/store-shadow-scope/_config.js create mode 100644 test/runtime/samples/store-shadow-scope/main.svelte create mode 100644 test/runtime/samples/store-template-expression-scope/_config.js create mode 100644 test/runtime/samples/store-template-expression-scope/main.svelte diff --git a/CHANGELOG.md b/CHANGELOG.md index c2de9bb5b2..9a4e588c9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * Do not display `a11y-missing-content` warning on elements with `contenteditable` bindings ([#5020](https://github.com/sveltejs/svelte/issues/5020)) * Fix handling of `this` in inline function expressions in the template ([#5033](https://github.com/sveltejs/svelte/issues/5033)) * Fix collapsing HTML with static content ([#5040](https://github.com/sveltejs/svelte/issues/5040)) +* Prevent use of `$store` at compile time when top-level `store` has been shadowed ([#5048](https://github.com/sveltejs/svelte/issues/5048)) * Update `