mirror of https://github.com/sveltejs/svelte
handle implicit and explicit-but-undefined props — fixes #2024
parent
89b00c7d30
commit
19f6727c8d
@ -0,0 +1,17 @@
|
|||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
x: 1
|
||||||
|
},
|
||||||
|
|
||||||
|
html: `
|
||||||
|
<pre>{"x":1}</pre>
|
||||||
|
`,
|
||||||
|
|
||||||
|
async test({ assert, component, target }) {
|
||||||
|
await component.$set({ x: 2 });
|
||||||
|
|
||||||
|
assert.htmlEqual(target.innerHTML, `
|
||||||
|
<pre>{"x":2}</pre>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,3 @@
|
|||||||
|
<svelte:options bind:props={foo}/>
|
||||||
|
|
||||||
|
<pre>{JSON.stringify(foo)}</pre>
|
@ -0,0 +1,3 @@
|
|||||||
|
export default {
|
||||||
|
error: `'foo' is not defined`
|
||||||
|
};
|
@ -0,0 +1,5 @@
|
|||||||
|
<script></script>
|
||||||
|
|
||||||
|
<svelte:options bind:props={foo}/>
|
||||||
|
|
||||||
|
<pre>{JSON.stringify(foo)}</pre>
|
Loading…
Reference in new issue