How to generate java class from javascript traceur compiler sources:

1. Download actual sources from http://code.google.com/p/traceur-compiler
2. Modify contents of "traceur-compiler/src" to get it work from Rhino:
2.1 Replace files ErrorReporter.js and ParseTreeVisitor.js with provided.
2.2 Assure that there is no occurences of "console".
2.3 Find occurences of "options.typeof", replace it with equivalent options["typeof"]
2.4 Move traceurStringCompiler.js to traceur-compiler/src
2.5 Remove "var import_script" and statement "script.forEach(importScript)" from traceur-compiler/src/traceur.js
3. Modify "inclusion_order" in merge_traceur.rb. Actual array can be got from traceur-compiler/src/traceur.js, and can be removed from there. Remove 'runtime/*' from it, add 'traceur.js' to the beginning and 'traceurStringCompiler.js' to the end.
4. Move merge_traceur.rb to traceur-compiler/src, run it with `ruby merge_traceur.rb`.
5. Get Rhino binary classes from IDEA sources(for compatibility), put them near traceur_merged.js(generated by merge_traceur.rb)
6. Run Rhino with `java org.mozilla.javascript.tools.jsc.Main -nosource -package com.intellij.lang.javascript.ecmascript6 -o TraceurFromJsSources traceur_merged.js`
7. Make jar from generated class with `jar cf ecmascript6-compiler.jar com\intellij\lang\javascript\ecmascript6\TraceurFromJsSources.class howto_update`
8. Replace %IDEA_SRC%\plugins\JavaScriptLanguage\lib\ecmascript6-compiler.jar with generated file.

Debugging

1. Complete steps 1-4 from upper sequence.
2. Add following lines to the end of traceur_merged.js:

var es6Source="function* d() {yield 1;}";
var es6Filename="DummyFilename.es6";
traceurTranslateString(es6Source, es6Filename);
                                                   
3. Run Rhino JavaScript Debugger `java org.mozilla.javascript.tools.debugger.Main traceur_merged.js`
