mirror of
https://github.com/sveltejs/svelte.git
synced 2024-11-30 08:56:14 +01:00
add test for $$props vars output
This commit is contained in:
parent
9508b0d3dd
commit
a9686ba39b
@ -152,7 +152,7 @@ export default class Component {
|
||||
} else if (name === '$$props') {
|
||||
this.add_var({
|
||||
name,
|
||||
implicit: true,
|
||||
injected: true,
|
||||
referenced: true
|
||||
});
|
||||
} else if (name[0] === '$') {
|
||||
@ -607,7 +607,7 @@ export default class Component {
|
||||
} else if (name === '$$props') {
|
||||
this.add_var({
|
||||
name,
|
||||
implicit: true
|
||||
injected: true
|
||||
});
|
||||
} else if (name[0] === '$') {
|
||||
this.add_var({
|
||||
|
16
test/vars/samples/$$props-logicless/_config.js
Normal file
16
test/vars/samples/$$props-logicless/_config.js
Normal file
@ -0,0 +1,16 @@
|
||||
export default {
|
||||
test(assert, vars) {
|
||||
assert.deepEqual(vars, [
|
||||
{
|
||||
name: '$$props',
|
||||
export_name: null,
|
||||
injected: true,
|
||||
module: false,
|
||||
mutated: false,
|
||||
reassigned: false,
|
||||
referenced: true,
|
||||
writable: false
|
||||
}
|
||||
]);
|
||||
}
|
||||
};
|
1
test/vars/samples/$$props-logicless/input.svelte
Normal file
1
test/vars/samples/$$props-logicless/input.svelte
Normal file
@ -0,0 +1 @@
|
||||
<h1>Hello {$$props.name}!</h1>
|
16
test/vars/samples/$$props/_config.js
Normal file
16
test/vars/samples/$$props/_config.js
Normal file
@ -0,0 +1,16 @@
|
||||
export default {
|
||||
test(assert, vars) {
|
||||
assert.deepEqual(vars, [
|
||||
{
|
||||
name: '$$props',
|
||||
export_name: null,
|
||||
injected: true,
|
||||
module: false,
|
||||
mutated: false,
|
||||
reassigned: false,
|
||||
referenced: true,
|
||||
writable: false
|
||||
}
|
||||
]);
|
||||
}
|
||||
};
|
3
test/vars/samples/$$props/input.svelte
Normal file
3
test/vars/samples/$$props/input.svelte
Normal file
@ -0,0 +1,3 @@
|
||||
<script></script>
|
||||
|
||||
<h1>Hello {$$props.name}!</h1>
|
Loading…
Reference in New Issue
Block a user