You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like using ref names in my CSS so I'm often tempted to use dash-style names such as ref:chart-container. If I use a dash, though, I get a cryptic error Assigning to rvalue. This took me a little while to figure out what I was doing wrong but it's because I believe the compiler creates code like this.refs.chart-container, which obviously isn't proper JavaScript. Here's the error in the REPL
It would be a nice to have but I don't really care if I can't (or shouldn't) use dashed names for whatever reason. If the error message can be improved, though, that would be great!
The text was updated successfully, but these errors were encountered:
Did some initial digging. The rvalue error is actually from the acorn parser located here.
Obviously that doesn't mean an issue needs to be made for Acorn but rather the Svelte code needs to be checking for that.
This is my first attempt at contributing to Svelte so let me know if this evaluation is incorrect, but we need to either
(the simpler case?) Throw a more specific error indicating foo-bar is invalid.
or
Allow foo-bar references by having the compiler output this.refs['chart-container'] instead of the invalid this.refs.chart-container.
I like using ref names in my CSS so I'm often tempted to use dash-style names such as
ref:chart-container
. If I use a dash, though, I get a cryptic errorAssigning to rvalue
. This took me a little while to figure out what I was doing wrong but it's because I believe the compiler creates code likethis.refs.chart-container
, which obviously isn't proper JavaScript. Here's the error in the REPLIt would be a nice to have but I don't really care if I can't (or shouldn't) use dashed names for whatever reason. If the error message can be improved, though, that would be great!
The text was updated successfully, but these errors were encountered: