riotjs-loader
riotjs-loader copied to clipboard
Square Bracket Notation Issues
Not sure if I should open this here or on Riot itself. Perhaps I'm also just doing it wrong :)
Regardless, this code:
<my-tag>
<td riot-tag="project-environment"
someproperty={ testing.subObject['this-doesnt-work'].wontGetHere } />
<script>
this.testing = {
'subObject': {
'this-doesnt-work': {
'wontGetHere': true
}
}
}
</script>
</my-tag>
gives this error in my Chrome console:
VM8130:3 Uncaught (in promise) SyntaxError: Invalid or unexpected token
and it looks like it compiles to this:
(function(E
/**/) {
try{return ("testing"in this?this:window).testing.subObject[â—0~].wontGetHere}catch(e){E(e,this)};
})
If I remove the square bracket notation by removing the hyphens and accessing the object directly, there is no issue. Thoughts? Thanks!