add a test which should pass without code change

pull/5942/head
Saurav Sahu 6 years ago
parent a6ac9f32a0
commit 66af40e3a9

@ -600,7 +600,7 @@ export default class Element extends Node {
validate_bindings_foreign() {
this.bindings
.filter(binding => binding.name !== 'this')
// .filter(binding => binding.name !== 'this')
.forEach(binding => {
this.component.error(binding, {
code: 'invalid-binding',

@ -119,4 +119,17 @@ describe('validate', () => {
});
}, /Invalid namespace 'foriegn' \(did you mean 'foreign'\?\)/);
});
it('throws an error if \'this\' is bound for foreign element', () => {
assert.throws(() => {
svelte.compile(`
<script>
let whatever;
</script>
<div bind:this={whatever} />`, {
name: 'test',
namespace: 'foreign'
});
}, /'this' is not a valid binding/)
})
});

Loading…
Cancel
Save