cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.45k stars 160 forks source link

Fail to convert byte[] to typed array #615

Closed thomasAtToem closed 3 years ago

thomasAtToem commented 4 years ago

By default , jsweet converts java arrays to standard js array. I tried several tricks to convert byte[] to a type uint8array but failed. What would be the proposed way of doing this (and not changing the java code).

thanks, thomas

lgrignon commented 4 years ago

Hello @thomasAtToem You are probably looking for a custom adapter: https://github.com/cincheo/jsweet/blob/master/doc/jsweet-language-specifications.md#extending-the-transpiler Did you check this out?

If you want to share your adapter, which could be useful to the community, you could add your class here https://github.com/cincheo/jsweet/tree/develop/transpiler/src/main/java/org/jsweet/transpiler/extension and PR

thomasAtToem commented 3 years ago

thanks for the input !