

Js2js: A revolutionary open-source compiler from JavaScript to JavaScript - bryanmikaelian
http://eleks.github.io/js2js/

======
LukeShu
The footer says that if you want a real "Javascript to Javascript
interpreter", to see js.js[0], which is a JS interpreter written JS; where the
satirical js2js is a JS-to-JS compiler, something different. If you want a
real JS to JS compiler, see Google's "Closure Compiler"[1].

[0]: [https://github.com/jterrace/js.js/](https://github.com/jterrace/js.js/)

[1]:
[https://developers.google.com/closure/compiler/](https://developers.google.com/closure/compiler/)
/ [https://github.com/google/closure-
compiler](https://github.com/google/closure-compiler)

~~~
grayrest
In the intervening years we've accumulated more js2js compilers. IMO the best
one is 6to5 [1].

[1] [http://6to5.org/](http://6to5.org/)

------
pkulak
Here's the real nut-meat

    
    
        Js2JsCompiler.prototype.compileCode = function(code) {
            return code; // as we need to compile javascript to javascript, we do nothing here :)
        };
    

Very helpfully commented!

------
ithkuil
It can also decompile JS back to JS, cool!

------
mgingras
Can you generate a map file for in-browser debugging?

------
adnanh
What is up with all these troll projects recently?

~~~
wwweston
Are you talking about:

(a) the obvious trolls, where the fact that it's a diversion is visible
quickly from the text/code, or (b) the non-obvious trolls, where a significant
chunk of the industry enthusiastically adopts something with marginal benefits
not only as a tool but an aspirational standard for 3-5 years before judging
it either a dead-end or inferior to the new hotness?

~~~
adnanh
Both!

------
ttcbj
Funny!

------
skorecky
eval();

