From 34d9830cc26ca3af1191dbaf6c7937e2f0248473 Mon Sep 17 00:00:00 2001 From: Saurav Sahu Date: Fri, 29 Jan 2021 23:20:40 +0530 Subject: [PATCH] test: should not throw error for bind:this --- src/compiler/compile/nodes/Element.ts | 2 +- test/validator/index.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts index 7fb4f4aeef..5a1e2ecfae 100644 --- a/src/compiler/compile/nodes/Element.ts +++ b/src/compiler/compile/nodes/Element.ts @@ -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', diff --git a/test/validator/index.ts b/test/validator/index.ts index 030ec59c75..5067315354 100644 --- a/test/validator/index.ts +++ b/test/validator/index.ts @@ -120,8 +120,8 @@ describe('validate', () => { }, /Invalid namespace 'foriegn' \(did you mean 'foreign'\?\)/); }); - it('throws an error if \'this\' is bound for foreign element', () => { - assert.throws(() => { + it('does not throw error if \'this\' is bound for foreign element', () => { + assert.doesNotThrow(() => { svelte.compile(`