-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Description
This is broken:
methods: {
'foo': () => {},
'bar': () => {}
}
Stack Trace
bundle.35d793bc40a79d89436e63d8b274bfd88d0208bd.js:1 ValidationError: Duplicate property 'undefined' at ValidationError.CompileError [as constructor] (https://unpkg.com/[email protected]/compiler/svelte.js:11347:28) at new ValidationError (https://unpkg.com/[email protected]/compiler/svelte.js:12555:28) at Validator.error (https://unpkg.com/[email protected]/compiler/svelte.js:12576:15) at https://unpkg.com/[email protected]/compiler/svelte.js:11501:23 at Array.forEach () at checkForDupes (https://unpkg.com/[email protected]/compiler/svelte.js:11499:16) at methods (https://unpkg.com/[email protected]/compiler/svelte.js:11685:5) at https://unpkg.com/[email protected]/compiler/svelte.js:12067:21 at Array.forEach () at https://unpkg.com/[email protected]/compiler/svelte.js:12064:41Admittedly, I encountered this whilst trying to hack svelte's static analysis of my method names. So, perhaps it is best that method names are not permitted to be quoted. I need to call some functions that are created at runtime, so I did this in oncreate this.someFunctions = makeSomeFunctions(args)
, in the view on:stuff="someFunctions.foo()", and
methods: { 'someFunctions.foo': noop }`. It was just a thought to get svelte to stop yelling at me. But quite hacky. Maybe it is good to prevent me and everyone from doing this.
Metadata
Metadata
Assignees
Labels
No labels