Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] correctly track dependencies of let: bindings (#7448)
Fixes #7440
- Loading branch information
Showing
6 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<slot/> |
5 changes: 5 additions & 0 deletions
5
test/runtime/samples/component-slot-let-in-slot-2/Outer.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
export let prop | ||
</script> | ||
|
||
<slot value={prop} /> |
25 changes: 25 additions & 0 deletions
25
test/runtime/samples/component-slot-let-in-slot-2/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
let logs; | ||
function log(value) { | ||
logs.push(value); | ||
} | ||
|
||
export default { | ||
props: { | ||
prop: 'a', | ||
log | ||
}, | ||
html: '<button></button>', | ||
before_test() { | ||
logs = []; | ||
}, | ||
async test({ assert, component, target, window }) { | ||
const button = target.querySelector('button'); | ||
await button.dispatchEvent(new window.MouseEvent('click')); | ||
|
||
assert.deepEqual(logs, ['a']); | ||
|
||
component.prop = 'b'; | ||
await button.dispatchEvent(new window.MouseEvent('click')); | ||
assert.deepEqual(logs, ['a', 'b']); | ||
} | ||
}; |
11 changes: 11 additions & 0 deletions
11
test/runtime/samples/component-slot-let-in-slot-2/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<script> | ||
import Outer from './Outer.svelte' | ||
import Inner from './Inner.svelte' | ||
export let prop | ||
export let log; | ||
</script> | ||
|
||
<Outer {prop} let:value> | ||
<Inner><button on:click={() => { log(value); }} /></Inner> | ||
</Outer> |