mirror of https://github.com/sveltejs/svelte
parent
01d32e53a9
commit
8c1d439a36
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: remove buggy `validate_dynamic_component` check
|
@ -1,12 +0,0 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
mode: ['client'],
|
||||
|
||||
compileOptions: {
|
||||
dev: true
|
||||
},
|
||||
|
||||
error:
|
||||
'svelte_component_invalid_this_value\nThe `this={...}` property of a `<svelte:component>` must be a Svelte component, if defined'
|
||||
});
|
@ -1,5 +0,0 @@
|
||||
<script>
|
||||
let banana = {};
|
||||
</script>
|
||||
|
||||
<svelte:component this={banana} />
|
@ -1 +0,0 @@
|
||||
<div>Sub</div>
|
@ -1,24 +0,0 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
compileOptions: {
|
||||
dev: true
|
||||
},
|
||||
get props() {
|
||||
return { componentName: 'Sub' };
|
||||
},
|
||||
html: '<div>Sub</div>',
|
||||
test({ assert, component, target }) {
|
||||
component.componentName = 'Proxy';
|
||||
assert.htmlEqual(target.innerHTML, '<div>Sub</div>');
|
||||
try {
|
||||
component.componentName = 'banana';
|
||||
throw new Error('Expected an error');
|
||||
} catch (err) {
|
||||
assert.include(
|
||||
/** @type {Error} */ (err).message,
|
||||
'svelte_component_invalid_this_value\nThe `this={...}` property of a `<svelte:component>` must be a Svelte component, if defined'
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
@ -1,14 +0,0 @@
|
||||
<script>
|
||||
import Sub from './Sub.svelte';
|
||||
export let componentName = 'Sub';
|
||||
let proxy = new Proxy(Sub, {});
|
||||
let banana = {};
|
||||
let component;
|
||||
$: {
|
||||
if (componentName === 'Sub') component = Sub;
|
||||
else if (componentName === 'Proxy') component = proxy;
|
||||
else component = banana;
|
||||
};
|
||||
</script>
|
||||
|
||||
<svelte:component this={component} />
|
Loading…
Reference in new issue