jsweet icon indicating copy to clipboard operation
jsweet copied to clipboard

variable name a keyword: with

Open schaumb opened this issue 6 years ago • 1 comments

int with = 0; is not compiling. In javascript "with" is a keyword, which is not accepted to be a variable name.

The other restricted keywords translated with prefix "__". This would also need it.

schaumb avatar Jul 21 '18 15:07 schaumb

That's a straitghtforward change to be made. Just add the "with" keyword to the list at https://github.com/cincheo/jsweet/blob/master/transpiler/src/main/java/org/jsweet/JSweetConfig.java#L389 (or maybe https://github.com/cincheo/jsweet/blob/master/transpiler/src/main/java/org/jsweet/JSweetConfig.java#L405). It should then work out of the box. A corresponding test would be welcome :)

renaudpawlak avatar Jul 24 '18 04:07 renaudpawlak