I found a bug in the current (V. 1.6) pas2js compiler:
Define an unnamed enum type in a implementation part of a unit:
var
modus : (text_, grafik_);
and initialize it in the initialization part:
modus:=text_;
When testing the value like
if modus=grafik_ then
showmessage('grafik');
if modus=text_ then
showmessage('text');
you see that it shows both messages.