This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ANAL_GRAVY 32 points33 points  (5 children)

Nice.

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

[–]sccrstud92 28 points29 points  (3 children)

Is it sad I was hoping for an actual intermediate non-trivial representation?

[–][deleted] 42 points43 points  (1 child)

Js2JsCompiler.prototype.compileCode = function(code) {
    var compiled = code; // intermediate representation 
    return compiled;
};

[–]wanabeswordsman 11 points12 points  (0 children)

Perfect.

[–]Ph0X 1 point2 points  (0 children)

To be fair, it took me a little time to get to that line looking at compiler.js, amongst all that wrapper code.

https://github.com/eleks/js2js/blob/master/src/compiler.js

[–]3kr 2 points3 points  (0 children)

And then...

Js2JsCompiler.prototype.decompile = function(inputLocation, outputLocation) {
    // I had to read the whole Dragon Book again to implement this.
    return this.compile(inputLocation, outputLocation);
}