kind2 icon indicating copy to clipboard operation
kind2 copied to clipboard

Generated JS may conflict with JS default types

Open mateusfccp opened this issue 1 year ago • 0 comments

For instance, if I define a String object in kind (as in the stdlib), the compiled JS will generate a const String = ....

This overrides the default String object. If you are dealing with Kind2-only scripts or you don't use any method of String, it's not a problem. However, if you want to use your Kind2 generated script with anything else (like another third-party library that probably uses String), you will get an error.

Example: image

A solution would be to generate namespaced and/or obfuscated symbols so that the conflict does not happen.

mateusfccp avatar Jul 29 '24 18:07 mateusfccp