Skip to content

Instantly share code, notes, and snippets.

Last active November 30, 2017 16:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
var src = 'var a, b, l = {a, [b]: {l}} = ({A}=a) => a = ({B=b}) => b = ({L=l}=40) => l';
// parse it
var syntaxNode = new Parser(src).parseProgram();
// transform what was parsed
var transformer = new Transformer();
transformer.renamer = renamer_minify;
var transformedNode =, false);
// emit what was transformed
var emitter = new Emitter(); = false; = false;
emitter.allow.comments.l = false;
emitter.allow.comments.m = false;
emitter.flushCurrentLine(); // flush whatever output that is still pending
// the compiled code:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment