Interesting exercise/experiment. It parses JS into a syntax tree, then puts it back together to JS again. Not sure if that can be called a "compiler"?
Admirable effort to write the compiler in the language that it implements.
Perhaps it can be more compact if the tokens were organized as a dictionary (object with tokens as properties) instead of separate constants, so that they can be looked up simpler than a list of if statements.