This is broken:
methods: {
'foo': () => {},
'bar': () => {}
}
REPL
Stack Trace
bundle.35d793bc40a79d89436e63d8b274bfd88d0208bd.js:1 ValidationError: Duplicate property 'undefined'
at ValidationError.CompileError [as constructor] (https://unpkg.com/svelte@1.41.2/compiler/svelte.js:11347:28)
at new ValidationError (https://unpkg.com/svelte@1.41.2/compiler/svelte.js:12555:28)
at Validator.error (https://unpkg.com/svelte@1.41.2/compiler/svelte.js:12576:15)
at https://unpkg.com/svelte@1.41.2/compiler/svelte.js:11501:23
at Array.forEach ()
at checkForDupes (https://unpkg.com/svelte@1.41.2/compiler/svelte.js:11499:16)
at methods (https://unpkg.com/svelte@1.41.2/compiler/svelte.js:11685:5)
at https://unpkg.com/svelte@1.41.2/compiler/svelte.js:12067:21
at Array.forEach ()
at https://unpkg.com/svelte@1.41.2/compiler/svelte.js:12064:41
Admittedly, 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.
This is broken:
REPL
Stack Trace
bundle.35d793bc40a79d89436e63d8b274bfd88d0208bd.js:1 ValidationError: Duplicate property 'undefined' at ValidationError.CompileError [as constructor] (https://unpkg.com/svelte@1.41.2/compiler/svelte.js:11347:28) at new ValidationError (https://unpkg.com/svelte@1.41.2/compiler/svelte.js:12555:28) at Validator.error (https://unpkg.com/svelte@1.41.2/compiler/svelte.js:12576:15) at https://unpkg.com/svelte@1.41.2/compiler/svelte.js:11501:23 at Array.forEach () at checkForDupes (https://unpkg.com/svelte@1.41.2/compiler/svelte.js:11499:16) at methods (https://unpkg.com/svelte@1.41.2/compiler/svelte.js:11685:5) at https://unpkg.com/svelte@1.41.2/compiler/svelte.js:12067:21 at Array.forEach () at https://unpkg.com/svelte@1.41.2/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 viewon:stuff="someFunctions.foo()", andmethods: { '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.