test: should not throw error for bind:this

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

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

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

Loading…
Cancel
Save