0
0
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:
Richard Harris 2019-03-09 21:44:19 -05:00
parent 9508b0d3dd
commit a9686ba39b
5 changed files with 38 additions and 2 deletions

View File

@ -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({

View 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
}
]);
}
};

View File

@ -0,0 +1 @@
<h1>Hello {$$props.name}!</h1>

View 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
}
]);
}
};

View File

@ -0,0 +1,3 @@
<script></script>
<h1>Hello {$$props.name}!</h1>