Invalid Swift code is accepted and produces invalid Javascript on shiftjs.com REPL
MikeMayer opened this issue · comments
Mike Mayer commented
Invalid swift statements:
var a = 3print("\(++a++)")
var a = 3;
print("\(++a++)")
Produce
var a = 3;
console.log(++ + a++ + '');
Which is also invalid Javascript. I was happy to see string interpolation worked so naturally I had to try and break it.
Deleted user commented
It's not yet doing any syntactical checks on the input. Given the state of Swift, assumption is that most devs might use Xcode for all error checking, then transpile with the CLI. Still far from being ready for production. Thus, our code assumes valid Swift code is inputted, but we appreciate your finding and will see if we can add the ability to reject invalid swift code in our project as a future goal.
Deleted user commented
Thanks Mike. I'm going to close this since it is covered by Issue 275