javascript: make it easier to use "outside" // core: fix generation of constant constructors in variant types