[
  {
    "path": ".gitignore",
    "content": ".DS_Store\n.tmp*~\n*.local.*\n.pinf-*\nnode_modules/\nnpm-debug.log\n"
  },
  {
    "path": "README.html",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n               \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"\nlang=\"en\" xml:lang=\"en\">\n<head>\n<title>UglifyJS &ndash; a JavaScript parser/compressor/beautifier</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"/>\n<meta name=\"generator\" content=\"Org-mode\"/>\n<meta name=\"generated\" content=\"2012-11-22 10:46:14 EET\"/>\n<meta name=\"author\" content=\"Mihai Bazon\"/>\n<meta name=\"description\" content=\"a JavaScript parser/compressor/beautifier in JavaScript\"/>\n<meta name=\"keywords\" content=\"javascript, js, parser, compiler, compressor, mangle, minify, minifier\"/>\n<style type=\"text/css\">\n <!--/*--><![CDATA[/*><!--*/\n  html { font-family: Times, serif; font-size: 12pt; }\n  .title  { text-align: center; }\n  .todo   { color: red; }\n  .done   { color: green; }\n  .tag    { background-color: #add8e6; font-weight:normal }\n  .target { }\n  .timestamp { color: #bebebe; }\n  .timestamp-kwd { color: #5f9ea0; }\n  .right  {margin-left:auto; margin-right:0px;  text-align:right;}\n  .left   {margin-left:0px;  margin-right:auto; text-align:left;}\n  .center {margin-left:auto; margin-right:auto; text-align:center;}\n  p.verse { margin-left: 3% }\n  pre {\n\tborder: 1pt solid #AEBDCC;\n\tbackground-color: #F3F5F7;\n\tpadding: 5pt;\n\tfont-family: courier, monospace;\n        font-size: 90%;\n        overflow:auto;\n  }\n  table { border-collapse: collapse; }\n  td, th { vertical-align: top;  }\n  th.right  { text-align:center;  }\n  th.left   { text-align:center;   }\n  th.center { text-align:center; }\n  td.right  { text-align:right;  }\n  td.left   { text-align:left;   }\n  td.center { text-align:center; }\n  dt { font-weight: bold; }\n  div.figure { padding: 0.5em; }\n  div.figure p { text-align: center; }\n  div.inlinetask {\n    padding:10px;\n    border:2px solid gray;\n    margin:10px;\n    background: #ffffcc;\n  }\n  textarea { overflow-x: auto; }\n  .linenr { font-size:smaller }\n  .code-highlighted {background-color:#ffff00;}\n  .org-info-js_info-navigation { border-style:none; }\n  #org-info-js_console-label { font-size:10px; font-weight:bold;\n                               white-space:nowrap; }\n  .org-info-js_search-highlight {background-color:#ffff00; color:#000000;\n                                 font-weight:bold; }\n  /*]]>*/-->\n</style>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"docstyle.css\" />\n<script type=\"text/javascript\">\n<!--/*--><![CDATA[/*><!--*/\n function CodeHighlightOn(elem, id)\n {\n   var target = document.getElementById(id);\n   if(null != target) {\n     elem.cacheClassElem = elem.className;\n     elem.cacheClassTarget = target.className;\n     target.className = \"code-highlighted\";\n     elem.className   = \"code-highlighted\";\n   }\n }\n function CodeHighlightOff(elem, id)\n {\n   var target = document.getElementById(id);\n   if(elem.cacheClassElem)\n     elem.className = elem.cacheClassElem;\n   if(elem.cacheClassTarget)\n     target.className = elem.cacheClassTarget;\n }\n/*]]>*///-->\n</script>\n\n</head>\n<body>\n\n<div id=\"preamble\">\n\n</div>\n\n<div id=\"content\">\n<h1 class=\"title\">UglifyJS &ndash; a JavaScript parser/compressor/beautifier</h1>\n\n\n<div id=\"table-of-contents\">\n<h2>Table of Contents</h2>\n<div id=\"text-table-of-contents\">\n<ul>\n<li><a href=\"#sec-1\">1 NEW: UglifyJS2 </a></li>\n<li><a href=\"#sec-2\">2 UglifyJS &mdash; a JavaScript parser/compressor/beautifier </a>\n<ul>\n<li><a href=\"#sec-2-1\">2.1 Unsafe transformations </a>\n<ul>\n<li><a href=\"#sec-2-1-1\">2.1.1 Calls involving the global Array constructor </a></li>\n<li><a href=\"#sec-2-1-2\">2.1.2 <code>obj.toString()</code> ==&gt; <code>obj+“”</code> </a></li>\n</ul>\n</li>\n<li><a href=\"#sec-2-2\">2.2 Install (NPM) </a></li>\n<li><a href=\"#sec-2-3\">2.3 Install latest code from GitHub </a></li>\n<li><a href=\"#sec-2-4\">2.4 Usage </a>\n<ul>\n<li><a href=\"#sec-2-4-1\">2.4.1 API </a></li>\n<li><a href=\"#sec-2-4-2\">2.4.2 Beautifier shortcoming &ndash; no more comments </a></li>\n<li><a href=\"#sec-2-4-3\">2.4.3 Use as a code pre-processor </a></li>\n</ul>\n</li>\n<li><a href=\"#sec-2-5\">2.5 Compression &ndash; how good is it? </a></li>\n<li><a href=\"#sec-2-6\">2.6 Bugs? </a></li>\n<li><a href=\"#sec-2-7\">2.7 Links </a></li>\n<li><a href=\"#sec-2-8\">2.8 License </a></li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n\n<div id=\"outline-container-1\" class=\"outline-2\">\n<h2 id=\"sec-1\"><span class=\"section-number-2\">1</span> NEW: UglifyJS2 </h2>\n<div class=\"outline-text-2\" id=\"text-1\">\n\n\n<p>\nI started working on UglifyJS's successor, version 2.  It's almost a full\nrewrite (except for the parser which is heavily modified, everything else\nstarts from scratch).  I've detailed my reasons in the README, see the\nproject page.\n</p>\n<p>\n<a href=\"https://github.com/mishoo/UglifyJS2\">https://github.com/mishoo/UglifyJS2</a>\n</p>\n<p>\nVersion 1 will continue to be maintained for fixing show-stopper bugs, but\nno new features should be expected.\n</p>\n</div>\n\n</div>\n\n<div id=\"outline-container-2\" class=\"outline-2\">\n<h2 id=\"sec-2\"><span class=\"section-number-2\">2</span> UglifyJS &mdash; a JavaScript parser/compressor/beautifier </h2>\n<div class=\"outline-text-2\" id=\"text-2\">\n\n\n<p>\nThis package implements a general-purpose JavaScript\nparser/compressor/beautifier toolkit.  It is developed on <a href=\"http://nodejs.org/\">NodeJS</a>, but it\nshould work on any JavaScript platform supporting the CommonJS module system\n(and if your platform of choice doesn't support CommonJS, you can easily\nimplement it, or discard the <code>exports.*</code> lines from UglifyJS sources).\n</p>\n<p>\nThe tokenizer/parser generates an abstract syntax tree from JS code.  You\ncan then traverse the AST to learn more about the code, or do various\nmanipulations on it.  This part is implemented in <a href=\"../lib/parse-js.js\">parse-js.js</a> and it's a\nport to JavaScript of the excellent <a href=\"http://marijn.haverbeke.nl/parse-js/\">parse-js</a> Common Lisp library from <a href=\"http://marijn.haverbeke.nl/\">Marijn Haverbeke</a>.\n</p>\n<p>\n( See <a href=\"http://github.com/mishoo/cl-uglify-js\">cl-uglify-js</a> if you're looking for the Common Lisp version of\nUglifyJS. )\n</p>\n<p>\nThe second part of this package, implemented in <a href=\"../lib/process.js\">process.js</a>, inspects and\nmanipulates the AST generated by the parser to provide the following:\n</p>\n<ul>\n<li>ability to re-generate JavaScript code from the AST.  Optionally\n  indented&mdash;you can use this if you want to “beautify” a program that has\n  been compressed, so that you can inspect the source.  But you can also run\n  our code generator to print out an AST without any whitespace, so you\n  achieve compression as well.\n\n</li>\n<li>shorten variable names (usually to single characters).  Our mangler will\n  analyze the code and generate proper variable names, depending on scope\n  and usage, and is smart enough to deal with globals defined elsewhere, or\n  with <code>eval()</code> calls or <code>with{}</code> statements.  In short, if <code>eval()</code> or\n  <code>with{}</code> are used in some scope, then all variables in that scope and any\n  variables in the parent scopes will remain unmangled, and any references\n  to such variables remain unmangled as well.\n\n</li>\n<li>various small optimizations that may lead to faster code but certainly\n  lead to smaller code.  Where possible, we do the following:\n\n<ul>\n<li>foo[\"bar\"]  ==&gt;  foo.bar\n\n</li>\n<li>remove block brackets <code>{}</code>\n\n</li>\n<li>join consecutive var declarations:\n    var a = 10; var b = 20; ==&gt; var a=10,b=20;\n\n</li>\n<li>resolve simple constant expressions: 1 +2 * 3 ==&gt; 7.  We only do the\n    replacement if the result occupies less bytes; for example 1/3 would\n    translate to 0.333333333333, so in this case we don't replace it.\n\n</li>\n<li>consecutive statements in blocks are merged into a sequence; in many\n    cases, this leaves blocks with a single statement, so then we can remove\n    the block brackets.\n\n</li>\n<li>various optimizations for IF statements:\n\n<ul>\n<li>if (foo) bar(); else baz(); ==&gt; foo?bar():baz();\n</li>\n<li>if (!foo) bar(); else baz(); ==&gt; foo?baz():bar();\n</li>\n<li>if (foo) bar(); ==&gt; foo&amp;&amp;bar();\n</li>\n<li>if (!foo) bar(); ==&gt; foo||bar();\n</li>\n<li>if (foo) return bar(); else return baz(); ==&gt; return foo?bar():baz();\n</li>\n<li>if (foo) return bar(); else something(); ==&gt; {if(foo)return bar();something()}\n\n</li>\n</ul>\n\n</li>\n<li>remove some unreachable code and warn about it (code that follows a\n    <code>return</code>, <code>throw</code>, <code>break</code> or <code>continue</code> statement, except\n    function/variable declarations).\n\n</li>\n<li>act a limited version of a pre-processor (c.f. the pre-processor of\n    C/C++) to allow you to safely replace selected global symbols with\n    specified values.  When combined with the optimisations above this can\n    make UglifyJS operate slightly more like a compilation process, in\n    that when certain symbols are replaced by constant values, entire code\n    blocks may be optimised away as unreachable.\n</li>\n</ul>\n\n</li>\n</ul>\n\n\n\n</div>\n\n<div id=\"outline-container-2-1\" class=\"outline-3\">\n<h3 id=\"sec-2-1\"><span class=\"section-number-3\">2.1</span> <span class=\"target\">Unsafe transformations</span>  </h3>\n<div class=\"outline-text-3\" id=\"text-2-1\">\n\n\n<p>\nThe following transformations can in theory break code, although they're\nprobably safe in most practical cases.  To enable them you need to pass the\n<code>--unsafe</code> flag.\n</p>\n\n</div>\n\n<div id=\"outline-container-2-1-1\" class=\"outline-4\">\n<h4 id=\"sec-2-1-1\"><span class=\"section-number-4\">2.1.1</span> Calls involving the global Array constructor </h4>\n<div class=\"outline-text-4\" id=\"text-2-1-1\">\n\n\n<p>\nThe following transformations occur:\n</p>\n\n\n\n<pre class=\"src src-js\"><span class=\"org-keyword\">new</span> <span class=\"org-type\">Array</span>(1, 2, 3, 4)  =&gt; [1,2,3,4]\nArray(a, b, c)         =&gt; [a,b,c]\n<span class=\"org-keyword\">new</span> <span class=\"org-type\">Array</span>(5)           =&gt; Array(5)\n<span class=\"org-keyword\">new</span> <span class=\"org-type\">Array</span>(a)           =&gt; Array(a)\n</pre>\n\n\n<p>\nThese are all safe if the Array name isn't redefined.  JavaScript does allow\none to globally redefine Array (and pretty much everything, in fact) but I\npersonally don't see why would anyone do that.\n</p>\n<p>\nUglifyJS does handle the case where Array is redefined locally, or even\nglobally but with a <code>function</code> or <code>var</code> declaration.  Therefore, in the\nfollowing cases UglifyJS <b>doesn't touch</b> calls or instantiations of Array:\n</p>\n\n\n\n<pre class=\"src src-js\"><span class=\"org-comment-delimiter\">// </span><span class=\"org-comment\">case 1.  globally declared variable</span>\n  <span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">Array</span>;\n  <span class=\"org-keyword\">new</span> <span class=\"org-type\">Array</span>(1, 2, 3);\n  Array(a, b);\n\n  <span class=\"org-comment-delimiter\">// </span><span class=\"org-comment\">or (can be declared later)</span>\n  <span class=\"org-keyword\">new</span> <span class=\"org-type\">Array</span>(1, 2, 3);\n  <span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">Array</span>;\n\n  <span class=\"org-comment-delimiter\">// </span><span class=\"org-comment\">or (can be a function)</span>\n  <span class=\"org-keyword\">new</span> <span class=\"org-type\">Array</span>(1, 2, 3);\n  <span class=\"org-keyword\">function</span> <span class=\"org-function-name\">Array</span>() { ... }\n\n<span class=\"org-comment-delimiter\">// </span><span class=\"org-comment\">case 2.  declared in a function</span>\n  (<span class=\"org-keyword\">function</span>(){\n    a = <span class=\"org-keyword\">new</span> <span class=\"org-type\">Array</span>(1, 2, 3);\n    b = Array(5, 6);\n    <span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">Array</span>;\n  })();\n\n  <span class=\"org-comment-delimiter\">// </span><span class=\"org-comment\">or</span>\n  (<span class=\"org-keyword\">function</span>(<span class=\"org-variable-name\">Array</span>){\n    <span class=\"org-keyword\">return</span> Array(5, 6, 7);\n  })();\n\n  <span class=\"org-comment-delimiter\">// </span><span class=\"org-comment\">or</span>\n  (<span class=\"org-keyword\">function</span>(){\n    <span class=\"org-keyword\">return</span> <span class=\"org-keyword\">new</span> <span class=\"org-type\">Array</span>(1, 2, 3, 4);\n    <span class=\"org-keyword\">function</span> <span class=\"org-function-name\">Array</span>() { ... }\n  })();\n\n  <span class=\"org-comment-delimiter\">// </span><span class=\"org-comment\">etc.</span>\n</pre>\n\n\n</div>\n\n</div>\n\n<div id=\"outline-container-2-1-2\" class=\"outline-4\">\n<h4 id=\"sec-2-1-2\"><span class=\"section-number-4\">2.1.2</span> <code>obj.toString()</code> ==&gt; <code>obj+“”</code> </h4>\n<div class=\"outline-text-4\" id=\"text-2-1-2\">\n\n\n</div>\n</div>\n\n</div>\n\n<div id=\"outline-container-2-2\" class=\"outline-3\">\n<h3 id=\"sec-2-2\"><span class=\"section-number-3\">2.2</span> Install (NPM) </h3>\n<div class=\"outline-text-3\" id=\"text-2-2\">\n\n\n<p>\nUglifyJS is now available through NPM &mdash; <code>npm install uglify-js@1</code> should\ndo the job.\n</p>\n<p>\n<b>NOTE:</b> The NPM package has been upgraded to UglifyJS2.  If you need to\ninstall version 1.x you need to add `@1` to the command, as I did above.  I\nstrongly suggest you to try to upgrade, though this might not be simple (v2\nhas a completely different AST structure and API).\n</p>\n</div>\n\n</div>\n\n<div id=\"outline-container-2-3\" class=\"outline-3\">\n<h3 id=\"sec-2-3\"><span class=\"section-number-3\">2.3</span> Install latest code from GitHub </h3>\n<div class=\"outline-text-3\" id=\"text-2-3\">\n\n\n\n\n\n<pre class=\"src src-sh\"><span class=\"org-comment-delimiter\">## </span><span class=\"org-comment\">clone the repository</span>\nmkdir -p /where/you/wanna/put/it\n<span class=\"org-builtin\">cd</span> /where/you/wanna/put/it\ngit clone git://github.com/mishoo/UglifyJS.git\n\n<span class=\"org-comment-delimiter\">## </span><span class=\"org-comment\">make the module available to Node</span>\nmkdir -p ~/.node_libraries/\n<span class=\"org-builtin\">cd</span> ~/.node_libraries/\nln -s /where/you/wanna/put/it/UglifyJS/uglify-js.js\n\n<span class=\"org-comment-delimiter\">## </span><span class=\"org-comment\">and if you want the CLI script too:</span>\nmkdir -p ~/bin\n<span class=\"org-builtin\">cd</span> ~/bin\nln -s /where/you/wanna/put/it/UglifyJS/bin/uglifyjs\n  <span class=\"org-comment-delimiter\"># </span><span class=\"org-comment\">(then add ~/bin to your $PATH if it's not there already)</span>\n</pre>\n\n\n</div>\n\n</div>\n\n<div id=\"outline-container-2-4\" class=\"outline-3\">\n<h3 id=\"sec-2-4\"><span class=\"section-number-3\">2.4</span> Usage </h3>\n<div class=\"outline-text-3\" id=\"text-2-4\">\n\n\n<p>\nThere is a command-line tool that exposes the functionality of this library\nfor your shell-scripting needs:\n</p>\n\n\n\n<pre class=\"src src-sh\">uglifyjs [ options... ] [ filename ]\n</pre>\n\n\n<p>\n<code>filename</code> should be the last argument and should name the file from which\nto read the JavaScript code.  If you don't specify it, it will read code\nfrom STDIN.\n</p>\n<p>\nSupported options:\n</p>\n<ul>\n<li><code>-b</code> or <code>--beautify</code> &mdash; output indented code; when passed, additional\n  options control the beautifier:\n\n<ul>\n<li><code>-i N</code> or <code>--indent N</code> &mdash; indentation level (number of spaces)\n\n</li>\n<li><code>-q</code> or <code>--quote-keys</code> &mdash; quote keys in literal objects (by default,\n    only keys that cannot be identifier names will be quotes).\n\n</li>\n</ul>\n\n</li>\n<li><code>-c</code> or <code>----consolidate-primitive-values</code> &mdash; consolidates null, Boolean,\n  and String values. Known as aliasing in the Closure Compiler. Worsens the\n  data compression ratio of gzip.\n\n</li>\n<li><code>--ascii</code> &mdash; pass this argument to encode non-ASCII characters as\n  <code>\\uXXXX</code> sequences.  By default UglifyJS won't bother to do it and will\n  output Unicode characters instead.  (the output is always encoded in UTF8,\n  but if you pass this option you'll only get ASCII).\n\n</li>\n<li><code>-nm</code> or <code>--no-mangle</code> &mdash; don't mangle names.\n\n</li>\n<li><code>-nmf</code> or <code>--no-mangle-functions</code> &ndash; in case you want to mangle variable\n  names, but not touch function names.\n\n</li>\n<li><code>-ns</code> or <code>--no-squeeze</code> &mdash; don't call <code>ast_squeeze()</code> (which does various\n  optimizations that result in smaller, less readable code).\n\n</li>\n<li><code>-mt</code> or <code>--mangle-toplevel</code> &mdash; mangle names in the toplevel scope too\n  (by default we don't do this).\n\n</li>\n<li><code>--no-seqs</code> &mdash; when <code>ast_squeeze()</code> is called (thus, unless you pass\n  <code>--no-squeeze</code>) it will reduce consecutive statements in blocks into a\n  sequence.  For example, \"a = 10; b = 20; foo();\" will be written as\n  \"a=10,b=20,foo();\".  In various occasions, this allows us to discard the\n  block brackets (since the block becomes a single statement).  This is ON\n  by default because it seems safe and saves a few hundred bytes on some\n  libs that I tested it on, but pass <code>--no-seqs</code> to disable it.\n\n</li>\n<li><code>--no-dead-code</code> &mdash; by default, UglifyJS will remove code that is\n  obviously unreachable (code that follows a <code>return</code>, <code>throw</code>, <code>break</code> or\n  <code>continue</code> statement and is not a function/variable declaration).  Pass\n  this option to disable this optimization.\n\n</li>\n<li><code>-nc</code> or <code>--no-copyright</code> &mdash; by default, <code>uglifyjs</code> will keep the initial\n  comment tokens in the generated code (assumed to be copyright information\n  etc.).  If you pass this it will discard it.\n\n</li>\n<li><code>-o filename</code> or <code>--output filename</code> &mdash; put the result in <code>filename</code>.  If\n  this isn't given, the result goes to standard output (or see next one).\n\n</li>\n<li><code>--overwrite</code> &mdash; if the code is read from a file (not from STDIN) and you\n  pass <code>--overwrite</code> then the output will be written in the same file.\n\n</li>\n<li><code>--ast</code> &mdash; pass this if you want to get the Abstract Syntax Tree instead\n  of JavaScript as output.  Useful for debugging or learning more about the\n  internals.\n\n</li>\n<li><code>-v</code> or <code>--verbose</code> &mdash; output some notes on STDERR (for now just how long\n  each operation takes).\n\n</li>\n<li><code>-d SYMBOL[=VALUE]</code> or <code>--define SYMBOL[=VALUE]</code> &mdash; will replace\n  all instances of the specified symbol where used as an identifier\n  (except where symbol has properly declared by a var declaration or\n  use as function parameter or similar) with the specified value. This\n  argument may be specified multiple times to define multiple\n  symbols - if no value is specified the symbol will be replaced with\n  the value <code>true</code>, or you can specify a numeric value (such as\n  <code>1024</code>), a quoted string value (such as =\"object\"= or\n  ='https://github.com'<code>), or the name of another symbol or keyword   (such as =null</code> or <code>document</code>).\n  This allows you, for example, to assign meaningful names to key\n  constant values but discard the symbolic names in the uglified\n  version for brevity/efficiency, or when used wth care, allows\n  UglifyJS to operate as a form of <b>conditional compilation</b>\n  whereby defining appropriate values may, by dint of the constant\n  folding and dead code removal features above, remove entire\n  superfluous code blocks (e.g. completely remove instrumentation or\n  trace code for production use).\n  Where string values are being defined, the handling of quotes are\n  likely to be subject to the specifics of your command shell\n  environment, so you may need to experiment with quoting styles\n  depending on your platform, or you may find the option\n  <code>--define-from-module</code> more suitable for use.\n\n</li>\n<li><code>-define-from-module SOMEMODULE</code> &mdash; will load the named module (as\n  per the NodeJS <code>require()</code> function) and iterate all the exported\n  properties of the module defining them as symbol names to be defined\n  (as if by the <code>--define</code> option) per the name of each property\n  (i.e. without the module name prefix) and given the value of the\n  property. This is a much easier way to handle and document groups of\n  symbols to be defined rather than a large number of <code>--define</code>\n  options.\n\n</li>\n<li><code>--unsafe</code> &mdash; enable other additional optimizations that are known to be\n  unsafe in some contrived situations, but could still be generally useful.\n  For now only these:\n\n<ul>\n<li>foo.toString()  ==&gt;  foo+\"\"\n</li>\n<li>new Array(x,&hellip;)  ==&gt; [x,&hellip;]\n</li>\n<li>new Array(x) ==&gt; Array(x)\n\n</li>\n</ul>\n\n</li>\n<li><code>--max-line-len</code> (default 32K characters) &mdash; add a newline after around\n  32K characters.  I've seen both FF and Chrome croak when all the code was\n  on a single line of around 670K.  Pass &ndash;max-line-len 0 to disable this\n  safety feature.\n\n</li>\n<li><code>--reserved-names</code> &mdash; some libraries rely on certain names to be used, as\n  pointed out in issue #92 and #81, so this option allow you to exclude such\n  names from the mangler.  For example, to keep names <code>require</code> and <code>$super</code>\n  intact you'd specify &ndash;reserved-names \"require,$super\".\n\n</li>\n<li><code>--inline-script</code> &ndash; when you want to include the output literally in an\n  HTML <code>&lt;script&gt;</code> tag you can use this option to prevent <code>&lt;/script</code> from\n  showing up in the output.\n\n</li>\n<li><code>--lift-vars</code> &ndash; when you pass this, UglifyJS will apply the following\n  transformations (see the notes in API, <code>ast_lift_variables</code>):\n\n<ul>\n<li>put all <code>var</code> declarations at the start of the scope\n</li>\n<li>make sure a variable is declared only once\n</li>\n<li>discard unused function arguments\n</li>\n<li>discard unused inner (named) functions\n</li>\n<li>finally, try to merge assignments into that one <code>var</code> declaration, if\n    possible.\n</li>\n</ul>\n\n</li>\n</ul>\n\n\n\n</div>\n\n<div id=\"outline-container-2-4-1\" class=\"outline-4\">\n<h4 id=\"sec-2-4-1\"><span class=\"section-number-4\">2.4.1</span> API </h4>\n<div class=\"outline-text-4\" id=\"text-2-4-1\">\n\n\n<p>\nTo use the library from JavaScript, you'd do the following (example for\nNodeJS):\n</p>\n\n\n\n<pre class=\"src src-js\"><span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">jsp</span> = require(<span class=\"org-string\">\"uglify-js\"</span>).parser;\n<span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">pro</span> = require(<span class=\"org-string\">\"uglify-js\"</span>).uglify;\n\n<span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">orig_code</span> = <span class=\"org-string\">\"... JS code here\"</span>;\n<span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">ast</span> = jsp.parse(orig_code); <span class=\"org-comment-delimiter\">// </span><span class=\"org-comment\">parse code and get the initial AST</span>\nast = pro.ast_mangle(ast); <span class=\"org-comment-delimiter\">// </span><span class=\"org-comment\">get a new AST with mangled names</span>\nast = pro.ast_squeeze(ast); <span class=\"org-comment-delimiter\">// </span><span class=\"org-comment\">get an AST with compression optimizations</span>\n<span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">final_code</span> = pro.gen_code(ast); <span class=\"org-comment-delimiter\">// </span><span class=\"org-comment\">compressed code here</span>\n</pre>\n\n\n<p>\nThe above performs the full compression that is possible right now.  As you\ncan see, there are a sequence of steps which you can apply.  For example if\nyou want compressed output but for some reason you don't want to mangle\nvariable names, you would simply skip the line that calls\n<code>pro.ast_mangle(ast)</code>.\n</p>\n<p>\nSome of these functions take optional arguments.  Here's a description:\n</p>\n<ul>\n<li><code>jsp.parse(code, strict_semicolons)</code> &ndash; parses JS code and returns an AST.\n  <code>strict_semicolons</code> is optional and defaults to <code>false</code>.  If you pass\n  <code>true</code> then the parser will throw an error when it expects a semicolon and\n  it doesn't find it.  For most JS code you don't want that, but it's useful\n  if you want to strictly sanitize your code.\n\n</li>\n<li><code>pro.ast_lift_variables(ast)</code> &ndash; merge and move <code>var</code> declarations to the\n  scop of the scope; discard unused function arguments or variables; discard\n  unused (named) inner functions.  It also tries to merge assignments\n  following the <code>var</code> declaration into it.\n\n<p>\n  If your code is very hand-optimized concerning <code>var</code> declarations, this\n  lifting variable declarations might actually increase size.  For me it\n  helps out.  On jQuery it adds 865 bytes (243 after gzip).  YMMV.  Also\n  note that (since it's not enabled by default) this operation isn't yet\n  heavily tested (please report if you find issues!).\n</p>\n<p>\n  Note that although it might increase the image size (on jQuery it gains\n  865 bytes, 243 after gzip) it's technically more correct: in certain\n  situations, dead code removal might drop variable declarations, which\n  would not happen if the variables are lifted in advance.\n</p>\n<p>\n  Here's an example of what it does:\n</p></li>\n</ul>\n\n\n\n\n\n<pre class=\"src src-js\"><span class=\"org-keyword\">function</span> <span class=\"org-function-name\">f</span>(<span class=\"org-variable-name\">a</span>, <span class=\"org-variable-name\">b</span>, <span class=\"org-variable-name\">c</span>, <span class=\"org-variable-name\">d</span>, <span class=\"org-variable-name\">e</span>) {\n    <span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">q</span>;\n    <span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">w</span>;\n    w = 10;\n    q = 20;\n    <span class=\"org-keyword\">for</span> (<span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">i</span> = 1; i &lt; 10; ++i) {\n        <span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">boo</span> = foo(a);\n    }\n    <span class=\"org-keyword\">for</span> (<span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">i</span> = 0; i &lt; 1; ++i) {\n        <span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">boo</span> = bar(c);\n    }\n    <span class=\"org-keyword\">function</span> <span class=\"org-function-name\">foo</span>(){ ... }\n    <span class=\"org-keyword\">function</span> <span class=\"org-function-name\">bar</span>(){ ... }\n    <span class=\"org-keyword\">function</span> <span class=\"org-function-name\">baz</span>(){ ... }\n}\n\n<span class=\"org-comment-delimiter\">// </span><span class=\"org-comment\">transforms into ==&gt;</span>\n\n<span class=\"org-keyword\">function</span> <span class=\"org-function-name\">f</span>(<span class=\"org-variable-name\">a</span>, <span class=\"org-variable-name\">b</span>, <span class=\"org-variable-name\">c</span>) {\n    <span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">i</span>, <span class=\"org-variable-name\">boo</span>, <span class=\"org-variable-name\">w</span> = 10, <span class=\"org-variable-name\">q</span> = 20;\n    <span class=\"org-keyword\">for</span> (i = 1; i &lt; 10; ++i) {\n        boo = foo(a);\n    }\n    <span class=\"org-keyword\">for</span> (i = 0; i &lt; 1; ++i) {\n        boo = bar(c);\n    }\n    <span class=\"org-keyword\">function</span> <span class=\"org-function-name\">foo</span>() { ... }\n    <span class=\"org-keyword\">function</span> <span class=\"org-function-name\">bar</span>() { ... }\n}\n</pre>\n\n\n<ul>\n<li><code>pro.ast_mangle(ast, options)</code> &ndash; generates a new AST containing mangled\n  (compressed) variable and function names.  It supports the following\n  options:\n\n<ul>\n<li><code>toplevel</code> &ndash; mangle toplevel names (by default we don't touch them).\n</li>\n<li><code>except</code> &ndash; an array of names to exclude from compression.\n</li>\n<li><code>defines</code> &ndash; an object with properties named after symbols to\n    replace (see the <code>--define</code> option for the script) and the values\n    representing the AST replacement value. For example,\n    <code>{ defines: { DEBUG: ['name', 'false'], VERSION: ['string', '1.0'] } }</code>\n\n</li>\n</ul>\n\n</li>\n<li><code>pro.ast_squeeze(ast, options)</code> &ndash; employs further optimizations designed\n  to reduce the size of the code that <code>gen_code</code> would generate from the\n  AST.  Returns a new AST.  <code>options</code> can be a hash; the supported options\n  are:\n\n<ul>\n<li><code>make_seqs</code> (default true) which will cause consecutive statements in a\n    block to be merged using the \"sequence\" (comma) operator\n\n</li>\n<li><code>dead_code</code> (default true) which will remove unreachable code.\n\n</li>\n</ul>\n\n</li>\n<li><code>pro.gen_code(ast, options)</code> &ndash; generates JS code from the AST.  By\n  default it's minified, but using the <code>options</code> argument you can get nicely\n  formatted output.  <code>options</code> is, well, optional :-) and if you pass it it\n  must be an object and supports the following properties (below you can see\n  the default values):\n\n<ul>\n<li><code>beautify: false</code> &ndash; pass <code>true</code> if you want indented output\n</li>\n<li><code>indent_start: 0</code> (only applies when <code>beautify</code> is <code>true</code>) &ndash; initial\n    indentation in spaces\n</li>\n<li><code>indent_level: 4</code> (only applies when <code>beautify</code> is <code>true</code>) --\n    indentation level, in spaces (pass an even number)\n</li>\n<li><code>quote_keys: false</code> &ndash; if you pass <code>true</code> it will quote all keys in\n    literal objects\n</li>\n<li><code>space_colon: false</code> (only applies when <code>beautify</code> is <code>true</code>) &ndash; wether\n    to put a space before the colon in object literals\n</li>\n<li><code>ascii_only: false</code> &ndash; pass <code>true</code> if you want to encode non-ASCII\n    characters as <code>\\uXXXX</code>.\n</li>\n<li><code>inline_script: false</code> &ndash; pass <code>true</code> to escape occurrences of\n    <code>&lt;/script</code> in strings\n</li>\n</ul>\n\n</li>\n</ul>\n\n\n</div>\n\n</div>\n\n<div id=\"outline-container-2-4-2\" class=\"outline-4\">\n<h4 id=\"sec-2-4-2\"><span class=\"section-number-4\">2.4.2</span> Beautifier shortcoming &ndash; no more comments </h4>\n<div class=\"outline-text-4\" id=\"text-2-4-2\">\n\n\n<p>\nThe beautifier can be used as a general purpose indentation tool.  It's\nuseful when you want to make a minified file readable.  One limitation,\nthough, is that it discards all comments, so you don't really want to use it\nto reformat your code, unless you don't have, or don't care about, comments.\n</p>\n<p>\nIn fact it's not the beautifier who discards comments &mdash; they are dumped at\nthe parsing stage, when we build the initial AST.  Comments don't really\nmake sense in the AST, and while we could add nodes for them, it would be\ninconvenient because we'd have to add special rules to ignore them at all\nthe processing stages.\n</p>\n</div>\n\n</div>\n\n<div id=\"outline-container-2-4-3\" class=\"outline-4\">\n<h4 id=\"sec-2-4-3\"><span class=\"section-number-4\">2.4.3</span> Use as a code pre-processor </h4>\n<div class=\"outline-text-4\" id=\"text-2-4-3\">\n\n\n<p>\nThe <code>--define</code> option can be used, particularly when combined with the\nconstant folding logic, as a form of pre-processor to enable or remove\nparticular constructions, such as might be used for instrumenting\ndevelopment code, or to produce variations aimed at a specific\nplatform.\n</p>\n<p>\nThe code below illustrates the way this can be done, and how the\nsymbol replacement is performed.\n</p>\n\n\n\n<pre class=\"src src-js\">CLAUSE1: <span class=\"org-keyword\">if</span> (<span class=\"org-keyword\">typeof</span> DEVMODE === <span class=\"org-string\">'undefined'</span>) {\n    DEVMODE = <span class=\"org-constant\">true</span>;\n}\n\n<span class=\"org-function-name\">CLAUSE2</span>: <span class=\"org-keyword\">function</span> init() {\n    <span class=\"org-keyword\">if</span> (DEVMODE) {\n        console.log(<span class=\"org-string\">\"init() called\"</span>);\n    }\n    ....\n    DEVMODE &amp;amp;&amp;amp; console.log(<span class=\"org-string\">\"init() complete\"</span>);\n}\n\n<span class=\"org-function-name\">CLAUSE3</span>: <span class=\"org-keyword\">function</span> reportDeviceStatus(<span class=\"org-variable-name\">device</span>) {\n    <span class=\"org-keyword\">var</span> <span class=\"org-variable-name\">DEVMODE</span> = device.mode, <span class=\"org-variable-name\">DEVNAME</span> = device.name;\n    <span class=\"org-keyword\">if</span> (DEVMODE === <span class=\"org-string\">'open'</span>) {\n        ....\n    }\n}\n</pre>\n\n\n<p>\nWhen the above code is normally executed, the undeclared global\nvariable <code>DEVMODE</code> will be assigned the value <b>true</b> (see <code>CLAUSE1</code>)\nand so the <code>init()</code> function (<code>CLAUSE2</code>) will write messages to the\nconsole log when executed, but in <code>CLAUSE3</code> a locally declared\nvariable will mask access to the <code>DEVMODE</code> global symbol.\n</p>\n<p>\nIf the above code is processed by UglifyJS with an argument of\n<code>--define DEVMODE=false</code> then UglifyJS will replace <code>DEVMODE</code> with the\nboolean constant value <b>false</b> within <code>CLAUSE1</code> and <code>CLAUSE2</code>, but it\nwill leave <code>CLAUSE3</code> as it stands because there <code>DEVMODE</code> resolves to\na validly declared variable.\n</p>\n<p>\nAnd more so, the constant-folding features of UglifyJS will recognise\nthat the <code>if</code> condition of <code>CLAUSE1</code> is thus always false, and so will\nremove the test and body of <code>CLAUSE1</code> altogether (including the\notherwise slightly problematical statement <code>false = true;</code> which it\nwill have formed by replacing <code>DEVMODE</code> in the body).  Similarly,\nwithin <code>CLAUSE2</code> both calls to <code>console.log()</code> will be removed\naltogether.\n</p>\n<p>\nIn this way you can mimic, to a limited degree, the functionality of\nthe C/C++ pre-processor to enable or completely remove blocks\ndepending on how certain symbols are defined - perhaps using UglifyJS\nto generate different versions of source aimed at different\nenvironments\n</p>\n<p>\nIt is recommmended (but not made mandatory) that symbols designed for\nthis purpose are given names consisting of <code>UPPER_CASE_LETTERS</code> to\ndistinguish them from other (normal) symbols and avoid the sort of\nclash that <code>CLAUSE3</code> above illustrates.\n</p>\n</div>\n</div>\n\n</div>\n\n<div id=\"outline-container-2-5\" class=\"outline-3\">\n<h3 id=\"sec-2-5\"><span class=\"section-number-3\">2.5</span> Compression &ndash; how good is it? </h3>\n<div class=\"outline-text-3\" id=\"text-2-5\">\n\n\n<p>\nHere are updated statistics.  (I also updated my Google Closure and YUI\ninstallations).\n</p>\n<p>\nWe're still a lot better than YUI in terms of compression, though slightly\nslower.  We're still a lot faster than Closure, and compression after gzip\nis comparable.\n</p>\n<table border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"groups\" frame=\"hsides\">\n<caption></caption>\n<colgroup><col class=\"left\" /><col class=\"left\" /><col class=\"right\" /><col class=\"left\" /><col class=\"right\" /><col class=\"left\" /><col class=\"right\" />\n</colgroup>\n<thead>\n<tr><th scope=\"col\" class=\"left\">File</th><th scope=\"col\" class=\"left\">UglifyJS</th><th scope=\"col\" class=\"right\">UglifyJS+gzip</th><th scope=\"col\" class=\"left\">Closure</th><th scope=\"col\" class=\"right\">Closure+gzip</th><th scope=\"col\" class=\"left\">YUI</th><th scope=\"col\" class=\"right\">YUI+gzip</th></tr>\n</thead>\n<tbody>\n<tr><td class=\"left\">jquery-1.6.2.js</td><td class=\"left\">91001 (0:01.59)</td><td class=\"right\">31896</td><td class=\"left\">90678 (0:07.40)</td><td class=\"right\">31979</td><td class=\"left\">101527 (0:01.82)</td><td class=\"right\">34646</td></tr>\n<tr><td class=\"left\">paper.js</td><td class=\"left\">142023 (0:01.65)</td><td class=\"right\">43334</td><td class=\"left\">134301 (0:07.42)</td><td class=\"right\">42495</td><td class=\"left\">173383 (0:01.58)</td><td class=\"right\">48785</td></tr>\n<tr><td class=\"left\">prototype.js</td><td class=\"left\">88544 (0:01.09)</td><td class=\"right\">26680</td><td class=\"left\">86955 (0:06.97)</td><td class=\"right\">26326</td><td class=\"left\">92130 (0:00.79)</td><td class=\"right\">28624</td></tr>\n<tr><td class=\"left\">thelib-full.js (DynarchLIB)</td><td class=\"left\">251939 (0:02.55)</td><td class=\"right\">72535</td><td class=\"left\">249911 (0:09.05)</td><td class=\"right\">72696</td><td class=\"left\">258869 (0:01.94)</td><td class=\"right\">76584</td></tr>\n</tbody>\n</table>\n\n\n</div>\n\n</div>\n\n<div id=\"outline-container-2-6\" class=\"outline-3\">\n<h3 id=\"sec-2-6\"><span class=\"section-number-3\">2.6</span> Bugs? </h3>\n<div class=\"outline-text-3\" id=\"text-2-6\">\n\n\n<p>\nUnfortunately, for the time being there is no automated test suite.  But I\nran the compressor manually on non-trivial code, and then I tested that the\ngenerated code works as expected.  A few hundred times.\n</p>\n<p>\nDynarchLIB was started in times when there was no good JS minifier.\nTherefore I was quite religious about trying to write short code manually,\nand as such DL contains a lot of syntactic hacks<sup><a class=\"footref\" name=\"fnr.1\" href=\"#fn.1\">1</a></sup> such as “foo == bar ?  a\n= 10 : b = 20”, though the more readable version would clearly be to use\n“if/else”.\n</p>\n<p>\nSince the parser/compressor runs fine on DL and jQuery, I'm quite confident\nthat it's solid enough for production use.  If you can identify any bugs,\nI'd love to hear about them (<a href=\"http://groups.google.com/group/uglifyjs\">use the Google Group</a> or email me directly).\n</p>\n</div>\n\n</div>\n\n<div id=\"outline-container-2-7\" class=\"outline-3\">\n<h3 id=\"sec-2-7\"><span class=\"section-number-3\">2.7</span> Links </h3>\n<div class=\"outline-text-3\" id=\"text-2-7\">\n\n\n<ul>\n<li>Twitter: <a href=\"http://twitter.com/UglifyJS\">@UglifyJS</a>\n</li>\n<li>Project at GitHub: <a href=\"http://github.com/mishoo/UglifyJS\">http://github.com/mishoo/UglifyJS</a>\n</li>\n<li>Google Group: <a href=\"http://groups.google.com/group/uglifyjs\">http://groups.google.com/group/uglifyjs</a>\n</li>\n<li>Common Lisp JS parser: <a href=\"http://marijn.haverbeke.nl/parse-js/\">http://marijn.haverbeke.nl/parse-js/</a>\n</li>\n<li>JS-to-Lisp compiler: <a href=\"http://github.com/marijnh/js\">http://github.com/marijnh/js</a>\n</li>\n<li>Common Lisp JS uglifier: <a href=\"http://github.com/mishoo/cl-uglify-js\">http://github.com/mishoo/cl-uglify-js</a>\n</li>\n</ul>\n\n\n</div>\n\n</div>\n\n<div id=\"outline-container-2-8\" class=\"outline-3\">\n<h3 id=\"sec-2-8\"><span class=\"section-number-3\">2.8</span> License </h3>\n<div class=\"outline-text-3\" id=\"text-2-8\">\n\n\n<p>\nUglifyJS is released under the BSD license:\n</p>\n\n\n\n<pre class=\"example\">Copyright 2010 (c) Mihai Bazon &lt;mihai.bazon@gmail.com&gt;\nBased on parse-js (http://marijn.haverbeke.nl/parse-js/).\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n    * Redistributions of source code must retain the above\n      copyright notice, this list of conditions and the following\n      disclaimer.\n\n    * Redistributions in binary form must reproduce the above\n      copyright notice, this list of conditions and the following\n      disclaimer in the documentation and/or other materials\n      provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\nOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\nTORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\nTHE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGE.\n</pre>\n\n\n<div id=\"footnotes\">\n<h2 class=\"footnotes\">Footnotes: </h2>\n<div id=\"text-footnotes\">\n<p class=\"footnote\"><sup><a class=\"footnum\" name=\"fn.1\" href=\"#fnr.1\">1</a></sup> I even reported a few bugs and suggested some fixes in the original\n    <a href=\"http://marijn.haverbeke.nl/parse-js/\">parse-js</a> library, and Marijn pushed fixes literally in minutes.\n</p></div>\n</div>\n</div>\n\n</div>\n</div>\n</div>\n\n<div id=\"postamble\">\n<p class=\"date\">Date: 2012-11-22 10:46:14 EET</p>\n<p class=\"author\">Author: Mihai Bazon</p>\n<p class=\"creator\">Org version 7.7 with Emacs version 24</p>\n<a href=\"http://validator.w3.org/check?uri=referer\">Validate XHTML 1.0</a>\n\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "README.org",
    "content": "#+TITLE: UglifyJS -- a JavaScript parser/compressor/beautifier\n#+KEYWORDS: javascript, js, parser, compiler, compressor, mangle, minify, minifier\n#+DESCRIPTION: a JavaScript parser/compressor/beautifier in JavaScript\n#+STYLE: <link rel=\"stylesheet\" type=\"text/css\" href=\"docstyle.css\" />\n#+AUTHOR: Mihai Bazon\n#+EMAIL: mihai.bazon@gmail.com\n\n* NEW: UglifyJS2\n\nI started working on UglifyJS's successor, version 2.  It's almost a full\nrewrite (except for the parser which is heavily modified, everything else\nstarts from scratch).  I've detailed my reasons in the README, see the\nproject page.\n\n[[https://github.com/mishoo/UglifyJS2][https://github.com/mishoo/UglifyJS2]]\n\nVersion 1 will continue to be maintained for fixing show-stopper bugs, but\nno new features should be expected.\n\n* UglifyJS --- a JavaScript parser/compressor/beautifier\n\nThis package implements a general-purpose JavaScript\nparser/compressor/beautifier toolkit.  It is developed on [[http://nodejs.org/][NodeJS]], but it\nshould work on any JavaScript platform supporting the CommonJS module system\n(and if your platform of choice doesn't support CommonJS, you can easily\nimplement it, or discard the =exports.*= lines from UglifyJS sources).\n\nThe tokenizer/parser generates an abstract syntax tree from JS code.  You\ncan then traverse the AST to learn more about the code, or do various\nmanipulations on it.  This part is implemented in [[../lib/parse-js.js][parse-js.js]] and it's a\nport to JavaScript of the excellent [[http://marijn.haverbeke.nl/parse-js/][parse-js]] Common Lisp library from [[http://marijn.haverbeke.nl/][Marijn\nHaverbeke]].\n\n( See [[http://github.com/mishoo/cl-uglify-js][cl-uglify-js]] if you're looking for the Common Lisp version of\nUglifyJS. )\n\nThe second part of this package, implemented in [[../lib/process.js][process.js]], inspects and\nmanipulates the AST generated by the parser to provide the following:\n\n- ability to re-generate JavaScript code from the AST.  Optionally\n  indented---you can use this if you want to “beautify” a program that has\n  been compressed, so that you can inspect the source.  But you can also run\n  our code generator to print out an AST without any whitespace, so you\n  achieve compression as well.\n\n- shorten variable names (usually to single characters).  Our mangler will\n  analyze the code and generate proper variable names, depending on scope\n  and usage, and is smart enough to deal with globals defined elsewhere, or\n  with =eval()= calls or =with{}= statements.  In short, if =eval()= or\n  =with{}= are used in some scope, then all variables in that scope and any\n  variables in the parent scopes will remain unmangled, and any references\n  to such variables remain unmangled as well.\n\n- various small optimizations that may lead to faster code but certainly\n  lead to smaller code.  Where possible, we do the following:\n\n  - foo[\"bar\"]  ==>  foo.bar\n\n  - remove block brackets ={}=\n\n  - join consecutive var declarations:\n    var a = 10; var b = 20; ==> var a=10,b=20;\n\n  - resolve simple constant expressions: 1 +2 * 3 ==> 7.  We only do the\n    replacement if the result occupies less bytes; for example 1/3 would\n    translate to 0.333333333333, so in this case we don't replace it.\n\n  - consecutive statements in blocks are merged into a sequence; in many\n    cases, this leaves blocks with a single statement, so then we can remove\n    the block brackets.\n\n  - various optimizations for IF statements:\n\n    - if (foo) bar(); else baz(); ==> foo?bar():baz();\n    - if (!foo) bar(); else baz(); ==> foo?baz():bar();\n    - if (foo) bar(); ==> foo&&bar();\n    - if (!foo) bar(); ==> foo||bar();\n    - if (foo) return bar(); else return baz(); ==> return foo?bar():baz();\n    - if (foo) return bar(); else something(); ==> {if(foo)return bar();something()}\n\n  - remove some unreachable code and warn about it (code that follows a\n    =return=, =throw=, =break= or =continue= statement, except\n    function/variable declarations).\n\n  - act a limited version of a pre-processor (c.f. the pre-processor of\n    C/C++) to allow you to safely replace selected global symbols with\n    specified values.  When combined with the optimisations above this can\n    make UglifyJS operate slightly more like a compilation process, in\n    that when certain symbols are replaced by constant values, entire code\n    blocks may be optimised away as unreachable.\n\n** <<Unsafe transformations>>\n\nThe following transformations can in theory break code, although they're\nprobably safe in most practical cases.  To enable them you need to pass the\n=--unsafe= flag.\n\n*** Calls involving the global Array constructor\n\nThe following transformations occur:\n\n#+BEGIN_SRC js\nnew Array(1, 2, 3, 4)  => [1,2,3,4]\nArray(a, b, c)         => [a,b,c]\nnew Array(5)           => Array(5)\nnew Array(a)           => Array(a)\n#+END_SRC\n\nThese are all safe if the Array name isn't redefined.  JavaScript does allow\none to globally redefine Array (and pretty much everything, in fact) but I\npersonally don't see why would anyone do that.\n\nUglifyJS does handle the case where Array is redefined locally, or even\nglobally but with a =function= or =var= declaration.  Therefore, in the\nfollowing cases UglifyJS *doesn't touch* calls or instantiations of Array:\n\n#+BEGIN_SRC js\n// case 1.  globally declared variable\n  var Array;\n  new Array(1, 2, 3);\n  Array(a, b);\n\n  // or (can be declared later)\n  new Array(1, 2, 3);\n  var Array;\n\n  // or (can be a function)\n  new Array(1, 2, 3);\n  function Array() { ... }\n\n// case 2.  declared in a function\n  (function(){\n    a = new Array(1, 2, 3);\n    b = Array(5, 6);\n    var Array;\n  })();\n\n  // or\n  (function(Array){\n    return Array(5, 6, 7);\n  })();\n\n  // or\n  (function(){\n    return new Array(1, 2, 3, 4);\n    function Array() { ... }\n  })();\n\n  // etc.\n#+END_SRC\n\n*** =obj.toString()= ==> =obj+“”=\n\n** Install (NPM)\n\nUglifyJS is now available through NPM --- =npm install uglify-js@1= should\ndo the job.\n\n*NOTE:* The NPM package has been upgraded to UglifyJS2.  If you need to\ninstall version 1.x you need to add `@1` to the command, as I did above.  I\nstrongly suggest you to try to upgrade, though this might not be simple (v2\nhas a completely different AST structure and API).\n\n** Install latest code from GitHub\n\n#+BEGIN_SRC sh\n## clone the repository\nmkdir -p /where/you/wanna/put/it\ncd /where/you/wanna/put/it\ngit clone git://github.com/mishoo/UglifyJS.git\n\n## make the module available to Node\nmkdir -p ~/.node_libraries/\ncd ~/.node_libraries/\nln -s /where/you/wanna/put/it/UglifyJS/uglify-js.js\n\n## and if you want the CLI script too:\nmkdir -p ~/bin\ncd ~/bin\nln -s /where/you/wanna/put/it/UglifyJS/bin/uglifyjs\n  # (then add ~/bin to your $PATH if it's not there already)\n#+END_SRC\n\n** Usage\n\nThere is a command-line tool that exposes the functionality of this library\nfor your shell-scripting needs:\n\n#+BEGIN_SRC sh\nuglifyjs [ options... ] [ filename ]\n#+END_SRC\n\n=filename= should be the last argument and should name the file from which\nto read the JavaScript code.  If you don't specify it, it will read code\nfrom STDIN.\n\nSupported options:\n\n- =-b= or =--beautify= --- output indented code; when passed, additional\n  options control the beautifier:\n\n  - =-i N= or =--indent N= --- indentation level (number of spaces)\n\n  - =-q= or =--quote-keys= --- quote keys in literal objects (by default,\n    only keys that cannot be identifier names will be quotes).\n\n- =-c= or =----consolidate-primitive-values= --- consolidates null, Boolean,\n  and String values. Known as aliasing in the Closure Compiler. Worsens the\n  data compression ratio of gzip.\n\n- =--ascii= --- pass this argument to encode non-ASCII characters as\n  =\\uXXXX= sequences.  By default UglifyJS won't bother to do it and will\n  output Unicode characters instead.  (the output is always encoded in UTF8,\n  but if you pass this option you'll only get ASCII).\n\n- =-nm= or =--no-mangle= --- don't mangle names.\n\n- =-nmf= or =--no-mangle-functions= -- in case you want to mangle variable\n  names, but not touch function names.\n\n- =-ns= or =--no-squeeze= --- don't call =ast_squeeze()= (which does various\n  optimizations that result in smaller, less readable code).\n\n- =-mt= or =--mangle-toplevel= --- mangle names in the toplevel scope too\n  (by default we don't do this).\n\n- =--no-seqs= --- when =ast_squeeze()= is called (thus, unless you pass\n  =--no-squeeze=) it will reduce consecutive statements in blocks into a\n  sequence.  For example, \"a = 10; b = 20; foo();\" will be written as\n  \"a=10,b=20,foo();\".  In various occasions, this allows us to discard the\n  block brackets (since the block becomes a single statement).  This is ON\n  by default because it seems safe and saves a few hundred bytes on some\n  libs that I tested it on, but pass =--no-seqs= to disable it.\n\n- =--no-dead-code= --- by default, UglifyJS will remove code that is\n  obviously unreachable (code that follows a =return=, =throw=, =break= or\n  =continue= statement and is not a function/variable declaration).  Pass\n  this option to disable this optimization.\n\n- =-nc= or =--no-copyright= --- by default, =uglifyjs= will keep the initial\n  comment tokens in the generated code (assumed to be copyright information\n  etc.).  If you pass this it will discard it.\n\n- =-o filename= or =--output filename= --- put the result in =filename=.  If\n  this isn't given, the result goes to standard output (or see next one).\n\n- =--overwrite= --- if the code is read from a file (not from STDIN) and you\n  pass =--overwrite= then the output will be written in the same file.\n\n- =--ast= --- pass this if you want to get the Abstract Syntax Tree instead\n  of JavaScript as output.  Useful for debugging or learning more about the\n  internals.\n\n- =-v= or =--verbose= --- output some notes on STDERR (for now just how long\n  each operation takes).\n\n- =-d SYMBOL[=VALUE]= or =--define SYMBOL[=VALUE]= --- will replace\n  all instances of the specified symbol where used as an identifier\n  (except where symbol has properly declared by a var declaration or\n  use as function parameter or similar) with the specified value. This\n  argument may be specified multiple times to define multiple\n  symbols - if no value is specified the symbol will be replaced with\n  the value =true=, or you can specify a numeric value (such as\n  =1024=), a quoted string value (such as =\"object\"= or\n  ='https://github.com'=), or the name of another symbol or keyword\n  (such as =null= or =document=).\n  This allows you, for example, to assign meaningful names to key\n  constant values but discard the symbolic names in the uglified\n  version for brevity/efficiency, or when used wth care, allows\n  UglifyJS to operate as a form of *conditional compilation*\n  whereby defining appropriate values may, by dint of the constant\n  folding and dead code removal features above, remove entire\n  superfluous code blocks (e.g. completely remove instrumentation or\n  trace code for production use).\n  Where string values are being defined, the handling of quotes are\n  likely to be subject to the specifics of your command shell\n  environment, so you may need to experiment with quoting styles\n  depending on your platform, or you may find the option\n  =--define-from-module= more suitable for use.\n\n- =-define-from-module SOMEMODULE= --- will load the named module (as\n  per the NodeJS =require()= function) and iterate all the exported\n  properties of the module defining them as symbol names to be defined\n  (as if by the =--define= option) per the name of each property\n  (i.e. without the module name prefix) and given the value of the\n  property. This is a much easier way to handle and document groups of\n  symbols to be defined rather than a large number of =--define=\n  options.\n\n- =--unsafe= --- enable other additional optimizations that are known to be\n  unsafe in some contrived situations, but could still be generally useful.\n  For now only these:\n\n  - foo.toString()  ==>  foo+\"\"\n  - new Array(x,...)  ==> [x,...]\n  - new Array(x) ==> Array(x)\n\n- =--max-line-len= (default 32K characters) --- add a newline after around\n  32K characters.  I've seen both FF and Chrome croak when all the code was\n  on a single line of around 670K.  Pass --max-line-len 0 to disable this\n  safety feature.\n\n- =--reserved-names= --- some libraries rely on certain names to be used, as\n  pointed out in issue #92 and #81, so this option allow you to exclude such\n  names from the mangler.  For example, to keep names =require= and =$super=\n  intact you'd specify --reserved-names \"require,$super\".\n\n- =--inline-script= -- when you want to include the output literally in an\n  HTML =<script>= tag you can use this option to prevent =</script= from\n  showing up in the output.\n\n- =--lift-vars= -- when you pass this, UglifyJS will apply the following\n  transformations (see the notes in API, =ast_lift_variables=):\n\n  - put all =var= declarations at the start of the scope\n  - make sure a variable is declared only once\n  - discard unused function arguments\n  - discard unused inner (named) functions\n  - finally, try to merge assignments into that one =var= declaration, if\n    possible.\n\n*** API\n\nTo use the library from JavaScript, you'd do the following (example for\nNodeJS):\n\n#+BEGIN_SRC js\nvar jsp = require(\"uglify-js\").parser;\nvar pro = require(\"uglify-js\").uglify;\n\nvar orig_code = \"... JS code here\";\nvar ast = jsp.parse(orig_code); // parse code and get the initial AST\nast = pro.ast_mangle(ast); // get a new AST with mangled names\nast = pro.ast_squeeze(ast); // get an AST with compression optimizations\nvar final_code = pro.gen_code(ast); // compressed code here\n#+END_SRC\n\nThe above performs the full compression that is possible right now.  As you\ncan see, there are a sequence of steps which you can apply.  For example if\nyou want compressed output but for some reason you don't want to mangle\nvariable names, you would simply skip the line that calls\n=pro.ast_mangle(ast)=.\n\nSome of these functions take optional arguments.  Here's a description:\n\n- =jsp.parse(code, strict_semicolons)= -- parses JS code and returns an AST.\n  =strict_semicolons= is optional and defaults to =false=.  If you pass\n  =true= then the parser will throw an error when it expects a semicolon and\n  it doesn't find it.  For most JS code you don't want that, but it's useful\n  if you want to strictly sanitize your code.\n\n- =pro.ast_lift_variables(ast)= -- merge and move =var= declarations to the\n  scop of the scope; discard unused function arguments or variables; discard\n  unused (named) inner functions.  It also tries to merge assignments\n  following the =var= declaration into it.\n\n  If your code is very hand-optimized concerning =var= declarations, this\n  lifting variable declarations might actually increase size.  For me it\n  helps out.  On jQuery it adds 865 bytes (243 after gzip).  YMMV.  Also\n  note that (since it's not enabled by default) this operation isn't yet\n  heavily tested (please report if you find issues!).\n\n  Note that although it might increase the image size (on jQuery it gains\n  865 bytes, 243 after gzip) it's technically more correct: in certain\n  situations, dead code removal might drop variable declarations, which\n  would not happen if the variables are lifted in advance.\n\n  Here's an example of what it does:\n\n#+BEGIN_SRC js\nfunction f(a, b, c, d, e) {\n    var q;\n    var w;\n    w = 10;\n    q = 20;\n    for (var i = 1; i < 10; ++i) {\n        var boo = foo(a);\n    }\n    for (var i = 0; i < 1; ++i) {\n        var boo = bar(c);\n    }\n    function foo(){ ... }\n    function bar(){ ... }\n    function baz(){ ... }\n}\n\n// transforms into ==>\n\nfunction f(a, b, c) {\n    var i, boo, w = 10, q = 20;\n    for (i = 1; i < 10; ++i) {\n        boo = foo(a);\n    }\n    for (i = 0; i < 1; ++i) {\n        boo = bar(c);\n    }\n    function foo() { ... }\n    function bar() { ... }\n}\n#+END_SRC\n\n- =pro.ast_mangle(ast, options)= -- generates a new AST containing mangled\n  (compressed) variable and function names.  It supports the following\n  options:\n\n  - =toplevel= -- mangle toplevel names (by default we don't touch them).\n  - =except= -- an array of names to exclude from compression.\n  - =defines= -- an object with properties named after symbols to\n    replace (see the =--define= option for the script) and the values\n    representing the AST replacement value. For example,\n    ={ defines: { DEBUG: ['name', 'false'], VERSION: ['string', '1.0'] } }=\n\n- =pro.ast_squeeze(ast, options)= -- employs further optimizations designed\n  to reduce the size of the code that =gen_code= would generate from the\n  AST.  Returns a new AST.  =options= can be a hash; the supported options\n  are:\n\n  - =make_seqs= (default true) which will cause consecutive statements in a\n    block to be merged using the \"sequence\" (comma) operator\n\n  - =dead_code= (default true) which will remove unreachable code.\n\n- =pro.gen_code(ast, options)= -- generates JS code from the AST.  By\n  default it's minified, but using the =options= argument you can get nicely\n  formatted output.  =options= is, well, optional :-) and if you pass it it\n  must be an object and supports the following properties (below you can see\n  the default values):\n\n  - =beautify: false= -- pass =true= if you want indented output\n  - =indent_start: 0= (only applies when =beautify= is =true=) -- initial\n    indentation in spaces\n  - =indent_level: 4= (only applies when =beautify= is =true=) --\n    indentation level, in spaces (pass an even number)\n  - =quote_keys: false= -- if you pass =true= it will quote all keys in\n    literal objects\n  - =space_colon: false= (only applies when =beautify= is =true=) -- wether\n    to put a space before the colon in object literals\n  - =ascii_only: false= -- pass =true= if you want to encode non-ASCII\n    characters as =\\uXXXX=.\n  - =inline_script: false= -- pass =true= to escape occurrences of\n    =</script= in strings\n\n*** Beautifier shortcoming -- no more comments\n\nThe beautifier can be used as a general purpose indentation tool.  It's\nuseful when you want to make a minified file readable.  One limitation,\nthough, is that it discards all comments, so you don't really want to use it\nto reformat your code, unless you don't have, or don't care about, comments.\n\nIn fact it's not the beautifier who discards comments --- they are dumped at\nthe parsing stage, when we build the initial AST.  Comments don't really\nmake sense in the AST, and while we could add nodes for them, it would be\ninconvenient because we'd have to add special rules to ignore them at all\nthe processing stages.\n\n*** Use as a code pre-processor\n\nThe =--define= option can be used, particularly when combined with the\nconstant folding logic, as a form of pre-processor to enable or remove\nparticular constructions, such as might be used for instrumenting\ndevelopment code, or to produce variations aimed at a specific\nplatform.\n\nThe code below illustrates the way this can be done, and how the\nsymbol replacement is performed.\n\n#+BEGIN_SRC js\nCLAUSE1: if (typeof DEVMODE === 'undefined') {\n    DEVMODE = true;\n}\n\nCLAUSE2: function init() {\n    if (DEVMODE) {\n        console.log(\"init() called\");\n    }\n    ....\n    DEVMODE &amp;&amp; console.log(\"init() complete\");\n}\n\nCLAUSE3: function reportDeviceStatus(device) {\n    var DEVMODE = device.mode, DEVNAME = device.name;\n    if (DEVMODE === 'open') {\n        ....\n    }\n}\n#+END_SRC\n\nWhen the above code is normally executed, the undeclared global\nvariable =DEVMODE= will be assigned the value *true* (see =CLAUSE1=)\nand so the =init()= function (=CLAUSE2=) will write messages to the\nconsole log when executed, but in =CLAUSE3= a locally declared\nvariable will mask access to the =DEVMODE= global symbol.\n\nIf the above code is processed by UglifyJS with an argument of\n=--define DEVMODE=false= then UglifyJS will replace =DEVMODE= with the\nboolean constant value *false* within =CLAUSE1= and =CLAUSE2=, but it\nwill leave =CLAUSE3= as it stands because there =DEVMODE= resolves to\na validly declared variable.\n\nAnd more so, the constant-folding features of UglifyJS will recognise\nthat the =if= condition of =CLAUSE1= is thus always false, and so will\nremove the test and body of =CLAUSE1= altogether (including the\notherwise slightly problematical statement =false = true;= which it\nwill have formed by replacing =DEVMODE= in the body).  Similarly,\nwithin =CLAUSE2= both calls to =console.log()= will be removed\naltogether.\n\nIn this way you can mimic, to a limited degree, the functionality of\nthe C/C++ pre-processor to enable or completely remove blocks\ndepending on how certain symbols are defined - perhaps using UglifyJS\nto generate different versions of source aimed at different\nenvironments\n\nIt is recommmended (but not made mandatory) that symbols designed for\nthis purpose are given names consisting of =UPPER_CASE_LETTERS= to\ndistinguish them from other (normal) symbols and avoid the sort of\nclash that =CLAUSE3= above illustrates.\n\n** Compression -- how good is it?\n\nHere are updated statistics.  (I also updated my Google Closure and YUI\ninstallations).\n\nWe're still a lot better than YUI in terms of compression, though slightly\nslower.  We're still a lot faster than Closure, and compression after gzip\nis comparable.\n\n| File                        | UglifyJS         | UglifyJS+gzip | Closure          | Closure+gzip | YUI              | YUI+gzip |\n|-----------------------------+------------------+---------------+------------------+--------------+------------------+----------|\n| jquery-1.6.2.js             | 91001 (0:01.59)  |         31896 | 90678 (0:07.40)  |        31979 | 101527 (0:01.82) |    34646 |\n| paper.js                    | 142023 (0:01.65) |         43334 | 134301 (0:07.42) |        42495 | 173383 (0:01.58) |    48785 |\n| prototype.js                | 88544 (0:01.09)  |         26680 | 86955 (0:06.97)  |        26326 | 92130 (0:00.79)  |    28624 |\n| thelib-full.js (DynarchLIB) | 251939 (0:02.55) |         72535 | 249911 (0:09.05) |        72696 | 258869 (0:01.94) |    76584 |\n\n** Bugs?\n\nUnfortunately, for the time being there is no automated test suite.  But I\nran the compressor manually on non-trivial code, and then I tested that the\ngenerated code works as expected.  A few hundred times.\n\nDynarchLIB was started in times when there was no good JS minifier.\nTherefore I was quite religious about trying to write short code manually,\nand as such DL contains a lot of syntactic hacks[1] such as “foo == bar ?  a\n= 10 : b = 20”, though the more readable version would clearly be to use\n“if/else”.\n\nSince the parser/compressor runs fine on DL and jQuery, I'm quite confident\nthat it's solid enough for production use.  If you can identify any bugs,\nI'd love to hear about them ([[http://groups.google.com/group/uglifyjs][use the Google Group]] or email me directly).\n\n[1] I even reported a few bugs and suggested some fixes in the original\n    [[http://marijn.haverbeke.nl/parse-js/][parse-js]] library, and Marijn pushed fixes literally in minutes.\n\n** Links\n\n- Twitter: [[http://twitter.com/UglifyJS][@UglifyJS]]\n- Project at GitHub: [[http://github.com/mishoo/UglifyJS][http://github.com/mishoo/UglifyJS]]\n- Google Group: [[http://groups.google.com/group/uglifyjs][http://groups.google.com/group/uglifyjs]]\n- Common Lisp JS parser: [[http://marijn.haverbeke.nl/parse-js/][http://marijn.haverbeke.nl/parse-js/]]\n- JS-to-Lisp compiler: [[http://github.com/marijnh/js][http://github.com/marijnh/js]]\n- Common Lisp JS uglifier: [[http://github.com/mishoo/cl-uglify-js][http://github.com/mishoo/cl-uglify-js]]\n\n** License\n\nUglifyJS is released under the BSD license:\n\n#+BEGIN_EXAMPLE\nCopyright 2010 (c) Mihai Bazon <mihai.bazon@gmail.com>\nBased on parse-js (http://marijn.haverbeke.nl/parse-js/).\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n    * Redistributions of source code must retain the above\n      copyright notice, this list of conditions and the following\n      disclaimer.\n\n    * Redistributions in binary form must reproduce the above\n      copyright notice, this list of conditions and the following\n      disclaimer in the documentation and/or other materials\n      provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\nOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\nTORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\nTHE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGE.\n#+END_EXAMPLE\n"
  },
  {
    "path": "bin/uglifyjs",
    "content": "#!/usr/bin/env node\n// -*- js -*-\n\nglobal.sys = require(/^v0\\.[012]/.test(process.version) ? \"sys\" : \"util\");\nvar fs = require(\"fs\"), path = require(\"path\");\nvar uglify = require(\"../uglify-js\"), // symlink ~/.node_libraries/uglify-js.js to ../uglify-js.js\n    consolidator = uglify.consolidator,\n    jsp = uglify.parser,\n    pro = uglify.uglify;\n\nvar options = {\n    ast: false,\n    consolidate: false,\n    mangle: true,\n    mangle_toplevel: false,\n    no_mangle_functions: false,\n    squeeze: true,\n    make_seqs: true,\n    dead_code: true,\n    verbose: false,\n    show_copyright: true,\n    out_same_file: false,\n    max_line_length: 32 * 1024,\n    unsafe: false,\n    reserved_names: null,\n    defines: { },\n    lift_vars: false,\n    codegen_options: {\n        ascii_only: false,\n        beautify: false,\n        indent_level: 4,\n        indent_start: 0,\n        quote_keys: false,\n        space_colon: false,\n        inline_script: false\n    },\n    make: false,\n    output: true            // stdout\n};\n\nvar args = jsp.slice(process.argv, 2);\nvar filename;\n\nout: while (args.length > 0) {\n    var v = args.shift();\n    switch (v) {\n      case \"-b\":\n      case \"--beautify\":\n        options.codegen_options.beautify = true;\n        break;\n      case \"-c\":\n      case \"--consolidate-primitive-values\":\n        options.consolidate = true;\n        break;\n      case \"-i\":\n      case \"--indent\":\n        options.codegen_options.indent_level = args.shift();\n        break;\n      case \"-q\":\n      case \"--quote-keys\":\n        options.codegen_options.quote_keys = true;\n        break;\n      case \"-mt\":\n      case \"--mangle-toplevel\":\n        options.mangle_toplevel = true;\n        break;\n      case \"-nmf\":\n      case \"--no-mangle-functions\":\n        options.no_mangle_functions = true;\n        break;\n      case \"--no-mangle\":\n      case \"-nm\":\n        options.mangle = false;\n        break;\n      case \"--no-squeeze\":\n      case \"-ns\":\n        options.squeeze = false;\n        break;\n      case \"--no-seqs\":\n        options.make_seqs = false;\n        break;\n      case \"--no-dead-code\":\n        options.dead_code = false;\n        break;\n      case \"--no-copyright\":\n      case \"-nc\":\n        options.show_copyright = false;\n        break;\n      case \"-o\":\n      case \"--output\":\n        options.output = args.shift();\n        break;\n      case \"--overwrite\":\n        options.out_same_file = true;\n        break;\n      case \"-v\":\n      case \"--verbose\":\n        options.verbose = true;\n        break;\n      case \"--ast\":\n        options.ast = true;\n        break;\n      case \"--unsafe\":\n        options.unsafe = true;\n        break;\n      case \"--max-line-len\":\n        options.max_line_length = parseInt(args.shift(), 10);\n        break;\n      case \"--reserved-names\":\n        options.reserved_names = args.shift().split(\",\");\n        break;\n      case \"--lift-vars\":\n        options.lift_vars = true;\n        break;\n      case \"-d\":\n      case \"--define\":\n        var defarg = args.shift();\n        try {\n            var defsym = function(sym) {\n                // KEYWORDS_ATOM doesn't include NaN or Infinity - should we check\n                // for them too ?? We don't check reserved words and the like as the\n                // define values are only substituted AFTER parsing\n                if (jsp.KEYWORDS_ATOM.hasOwnProperty(sym)) {\n                    throw \"Don't define values for inbuilt constant '\"+sym+\"'\";\n                }\n                return sym;\n            },\n            defval = function(v) {\n                if (v.match(/^\"(.*)\"$/) || v.match(/^'(.*)'$/)) {\n                    return [ \"string\", RegExp.$1 ];\n                }\n                else if (!isNaN(parseFloat(v))) {\n                    return [ \"num\", parseFloat(v) ];\n                }\n                else if (v.match(/^[a-z\\$_][a-z\\$_0-9]*$/i)) {\n                    return [ \"name\", v ];\n                }\n                else if (!v.match(/\"/)) {\n                    return [ \"string\", v ];\n                }\n                else if (!v.match(/'/)) {\n                    return [ \"string\", v ];\n                }\n                throw \"Can't understand the specified value: \"+v;\n            };\n            if (defarg.match(/^([a-z_\\$][a-z_\\$0-9]*)(=(.*))?$/i)) {\n                var sym = defsym(RegExp.$1),\n                val = RegExp.$2 ? defval(RegExp.$2.substr(1)) : [ 'name', 'true' ];\n                options.defines[sym] = val;\n            }\n            else {\n                throw \"The --define option expects SYMBOL[=value]\";\n            }\n        } catch(ex) {\n            sys.print(\"ERROR: In option --define \"+defarg+\"\\n\"+ex+\"\\n\");\n            process.exit(1);\n        }\n        break;\n      case \"--define-from-module\":\n        var defmodarg = args.shift();\n        var defmodule = require(defmodarg);\n        var sym, val;\n        for (sym in defmodule) {\n            if (defmodule.hasOwnProperty(sym)) {\n                options.defines[sym] = function(val) {\n                    if (typeof val == \"string\")\n                        return [ \"string\", val ];\n                    if (typeof val == \"number\")\n                        return [ \"num\", val ];\n                    if (val === true)\n                        return [ 'name', 'true' ];\n                    if (val === false)\n                        return [ 'name', 'false' ];\n                    if (val === null)\n                        return [ 'name', 'null' ];\n                    if (val === undefined)\n                        return [ 'name', 'undefined' ];\n                    sys.print(\"ERROR: In option --define-from-module \"+defmodarg+\"\\n\");\n                    sys.print(\"ERROR: Unknown object type for: \"+sym+\"=\"+val+\"\\n\");\n                    process.exit(1);\n                    return null;\n                }(defmodule[sym]);\n            }\n        }\n        break;\n      case \"--ascii\":\n        options.codegen_options.ascii_only = true;\n        break;\n      case \"--make\":\n        options.make = true;\n        break;\n      case \"--inline-script\":\n        options.codegen_options.inline_script = true;\n        break;\n      default:\n        filename = v;\n        break out;\n    }\n}\n\nif (options.verbose) {\n    pro.set_logger(function(msg){\n        sys.debug(msg);\n    });\n}\n\njsp.set_logger(function(msg){\n    sys.debug(msg);\n});\n\nif (options.make) {\n    options.out_same_file = false; // doesn't make sense in this case\n    var makefile = global.eval(\"(\" + fs.readFileSync(filename || \"Makefile.uglify.js\").toString() + \")\");\n    var dir = path.dirname(filename);\n    output(makefile.files.map(function(file){\n        var code = fs.readFileSync(path.join(dir, file.name)).toString();\n        if (file.module) {\n            code = \"!function(exports, global){global = this;\\n\" + code + \"\\n;this.\" + file.module + \" = exports;}({})\";\n        }\n        else if (file.hide) {\n            code = \"(function(){\" + code + \"}());\";\n        }\n        return squeeze_it(code);\n    }).join(\"\\n\"));\n}\nelse if (filename) {\n    fs.readFile(filename, \"utf8\", function(err, text){\n        if (err) throw err;\n        output(squeeze_it(text));\n    });\n}\nelse {\n    var stdin = process.openStdin();\n    stdin.setEncoding(\"utf8\");\n    var text = \"\";\n    stdin.on(\"data\", function(chunk){\n        text += chunk;\n    });\n    stdin.on(\"end\", function() {\n        output(squeeze_it(text));\n    });\n}\n\nfunction output(text) {\n    var out;\n    if (options.out_same_file && filename)\n        options.output = filename;\n    if (options.output === true) {\n        out = process.stdout;\n    } else {\n        out = fs.createWriteStream(options.output, {\n            flags: \"w\",\n            encoding: \"utf8\",\n            mode: 0644\n        });\n    }\n    out.write(text.replace(/;*$/, \";\"));\n    if (options.output !== true) {\n        out.end();\n    }\n};\n\n// --------- main ends here.\n\nfunction show_copyright(comments) {\n    var ret = \"\";\n    for (var i = 0; i < comments.length; ++i) {\n        var c = comments[i];\n        if (c.type == \"comment1\") {\n            ret += \"//\" + c.value + \"\\n\";\n        } else {\n            ret += \"/*\" + c.value + \"*/\";\n        }\n    }\n    return ret;\n};\n\nfunction squeeze_it(code) {\n    var result = \"\";\n    if (options.show_copyright) {\n        var tok = jsp.tokenizer(code), c;\n        c = tok();\n        result += show_copyright(c.comments_before);\n    }\n    try {\n        var ast = time_it(\"parse\", function(){ return jsp.parse(code); });\n        if (options.consolidate) ast = time_it(\"consolidate\", function(){\n            return consolidator.ast_consolidate(ast);\n        });\n        if (options.lift_vars) {\n            ast = time_it(\"lift\", function(){ return pro.ast_lift_variables(ast); });\n        }\n        ast = time_it(\"mangle\", function(){\n            return pro.ast_mangle(ast, {\n                mangle       : options.mangle,\n                toplevel     : options.mangle_toplevel,\n                defines      : options.defines,\n                except       : options.reserved_names,\n                no_functions : options.no_mangle_functions\n            });\n        });\n        if (options.squeeze) ast = time_it(\"squeeze\", function(){\n            ast = pro.ast_squeeze(ast, {\n                make_seqs  : options.make_seqs,\n                dead_code  : options.dead_code,\n                keep_comps : !options.unsafe,\n                unsafe     : options.unsafe\n            });\n            if (options.unsafe)\n                ast = pro.ast_squeeze_more(ast);\n            return ast;\n        });\n        if (options.ast)\n            return sys.inspect(ast, null, null);\n        result += time_it(\"generate\", function(){ return pro.gen_code(ast, options.codegen_options) });\n        if (!options.codegen_options.beautify && options.max_line_length) {\n            result = time_it(\"split\", function(){ return pro.split_lines(result, options.max_line_length) });\n        }\n        return result;\n    } catch(ex) {\n        sys.debug(ex.stack);\n        sys.debug(sys.inspect(ex));\n        sys.debug(JSON.stringify(ex));\n        process.exit(1);\n    }\n};\n\nfunction time_it(name, cont) {\n    if (!options.verbose)\n        return cont();\n    var t1 = new Date().getTime();\n    try { return cont(); }\n    finally { sys.debug(\"// \" + name + \": \" + ((new Date().getTime() - t1) / 1000).toFixed(3) + \" sec.\"); }\n};\n"
  },
  {
    "path": "docstyle.css",
    "content": "html { font-family: \"Lucida Grande\",\"Trebuchet MS\",sans-serif; font-size: 12pt; }\nbody { max-width: 60em; }\n.title  { text-align: center; }\n.todo   { color: red; }\n.done   { color: green; }\n.tag    { background-color:lightblue; font-weight:normal }\n.target { }\n.timestamp { color: grey }\n.timestamp-kwd { color: CadetBlue }\np.verse { margin-left: 3% }\npre {\n  border: 1pt solid #AEBDCC;\n  background-color: #F3F5F7;\n  padding: 5pt;\n  font-family: monospace;\n  font-size: 90%;\n  overflow:auto;\n}\npre.src {\n  background-color: #eee; color: #112; border: 1px solid #000;\n}\ntable { border-collapse: collapse; }\ntd, th { vertical-align: top; }\ndt { font-weight: bold; }\ndiv.figure { padding: 0.5em; }\ndiv.figure p { text-align: center; }\n.linenr { font-size:smaller }\n.code-highlighted {background-color:#ffff00;}\n.org-info-js_info-navigation { border-style:none; }\n#org-info-js_console-label { font-size:10px; font-weight:bold;\n  white-space:nowrap; }\n.org-info-js_search-highlight {background-color:#ffff00; color:#000000;\n  font-weight:bold; }\n\nsup {\n  vertical-align: baseline;\n  position: relative;\n  top: -0.5em;\n  font-size: 80%;\n}\n\nsup a:link, sup a:visited {\n  text-decoration: none;\n  color: #c00;\n}\n\nsup a:before { content: \"[\"; color: #999; }\nsup a:after { content: \"]\"; color: #999; }\n\nh1.title { border-bottom: 4px solid #000; padding-bottom: 5px; margin-bottom: 2em; }\n\n#postamble {\n  color: #777;\n  font-size: 90%;\n  padding-top: 1em; padding-bottom: 1em; border-top: 1px solid #999;\n  margin-top: 2em;\n  padding-left: 2em;\n  padding-right: 2em;\n  text-align: right;\n}\n\n#postamble p { margin: 0; }\n\n#footnotes { border-top: 1px solid #000; }\n\nh1 { font-size: 200% }\nh2 { font-size: 175% }\nh3 { font-size: 150% }\nh4 { font-size: 125% }\n\nh1, h2, h3, h4 { font-family: \"Bookman\",Georgia,\"Times New Roman\",serif; font-weight: normal; }\n\n@media print {\n  html { font-size: 11pt; }\n}\n"
  },
  {
    "path": "lib/consolidator.js",
    "content": "/**\n * @preserve Copyright 2012 Robert Gust-Bardon <http://robert.gust-bardon.org/>.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n *     * Redistributions of source code must retain the above\n *       copyright notice, this list of conditions and the following\n *       disclaimer.\n *\n *     * Redistributions in binary form must reproduce the above\n *       copyright notice, this list of conditions and the following\n *       disclaimer in the documentation and/or other materials\n *       provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n/**\n * @fileoverview Enhances <a href=\"https://github.com/mishoo/UglifyJS/\"\n * >UglifyJS</a> with consolidation of null, Boolean, and String values.\n * <p>Also known as aliasing, this feature has been deprecated in <a href=\n * \"http://closure-compiler.googlecode.com/\">the Closure Compiler</a> since its\n * initial release, where it is unavailable from the <abbr title=\n * \"command line interface\">CLI</a>. The Closure Compiler allows one to log and\n * influence this process. In contrast, this implementation does not introduce\n * any variable declarations in global code and derives String values from\n * identifier names used as property accessors.</p>\n * <p>Consolidating literals may worsen the data compression ratio when an <a\n * href=\"http://tools.ietf.org/html/rfc2616#section-3.5\">encoding\n * transformation</a> is applied. For instance, <a href=\n * \"http://code.jquery.com/jquery-1.7.1.js\">jQuery 1.7.1</a> takes 248235 bytes.\n * Building it with <a href=\"https://github.com/mishoo/UglifyJS/tarball/v1.2.5\">\n * UglifyJS v1.2.5</a> results in 93647 bytes (37.73% of the original) which are\n * then compressed to 33154 bytes (13.36% of the original) using <a href=\n * \"http://linux.die.net/man/1/gzip\">gzip(1)</a>. Building it with the same\n * version of UglifyJS 1.2.5 patched with the implementation of consolidation\n * results in 80784 bytes (a decrease of 12863 bytes, i.e. 13.74%, in comparison\n * to the aforementioned 93647 bytes) which are then compressed to 34013 bytes\n * (an increase of 859 bytes, i.e. 2.59%, in comparison to the aforementioned\n * 33154 bytes).</p>\n * <p>Written in <a href=\"http://es5.github.com/#x4.2.2\">the strict variant</a>\n * of <a href=\"http://es5.github.com/\">ECMA-262 5.1 Edition</a>. Encoded in <a\n * href=\"http://tools.ietf.org/html/rfc3629\">UTF-8</a>. Follows <a href=\n * \"http://google-styleguide.googlecode.com/svn-history/r76/trunk/javascriptguide.xml\"\n * >Revision 2.28 of the Google JavaScript Style Guide</a> (except for the\n * discouraged use of the {@code function} tag and the {@code namespace} tag).\n * 100% typed for the <a href=\n * \"http://closure-compiler.googlecode.com/files/compiler-20120123.tar.gz\"\n * >Closure Compiler Version 1741</a>.</p>\n * <p>Should you find this software useful, please consider <a href=\n * \"https://paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JZLW72X8FD4WG\"\n * >a donation</a>.</p>\n * @author follow.me@RGustBardon (Robert Gust-Bardon)\n * @supported Tested with:\n *     <ul>\n *     <li><a href=\"http://nodejs.org/dist/v0.6.10/\">Node v0.6.10</a>,</li>\n *     <li><a href=\"https://github.com/mishoo/UglifyJS/tarball/v1.2.5\">UglifyJS\n *       v1.2.5</a>.</li>\n *     </ul>\n */\n\n/*global console:false, exports:true, module:false, require:false */\n/*jshint sub:true */\n/**\n * Consolidates null, Boolean, and String values found inside an <abbr title=\n * \"abstract syntax tree\">AST</abbr>.\n * @param {!TSyntacticCodeUnit} oAbstractSyntaxTree An array-like object\n *     representing an <abbr title=\"abstract syntax tree\">AST</abbr>.\n * @return {!TSyntacticCodeUnit} An array-like object representing an <abbr\n *     title=\"abstract syntax tree\">AST</abbr> with its null, Boolean, and\n *     String values consolidated.\n */\n// TODO(user) Consolidation of mathematical values found in numeric literals.\n// TODO(user) Unconsolidation.\n// TODO(user) Consolidation of ECMA-262 6th Edition programs.\n// TODO(user) Rewrite in ECMA-262 6th Edition.\nexports['ast_consolidate'] = function(oAbstractSyntaxTree) {\n  'use strict';\n  /*jshint bitwise:true, curly:true, eqeqeq:true, forin:true, immed:true,\n        latedef:true, newcap:true, noarge:true, noempty:true, nonew:true,\n        onevar:true, plusplus:true, regexp:true, undef:true, strict:true,\n        sub:false, trailing:true */\n\n  var _,\n      /**\n       * A record consisting of data about one or more source elements.\n       * @constructor\n       * @nosideeffects\n       */\n      TSourceElementsData = function() {\n        /**\n         * The category of the elements.\n         * @type {number}\n         * @see ESourceElementCategories\n         */\n        this.nCategory = ESourceElementCategories.N_OTHER;\n        /**\n         * The number of occurrences (within the elements) of each primitive\n         * value that could be consolidated.\n         * @type {!Array.<!Object.<string, number>>}\n         */\n        this.aCount = [];\n        this.aCount[EPrimaryExpressionCategories.N_IDENTIFIER_NAMES] = {};\n        this.aCount[EPrimaryExpressionCategories.N_STRING_LITERALS] = {};\n        this.aCount[EPrimaryExpressionCategories.N_NULL_AND_BOOLEAN_LITERALS] =\n            {};\n        /**\n         * Identifier names found within the elements.\n         * @type {!Array.<string>}\n         */\n        this.aIdentifiers = [];\n        /**\n         * Prefixed representation Strings of each primitive value that could be\n         * consolidated within the elements.\n         * @type {!Array.<string>}\n         */\n        this.aPrimitiveValues = [];\n      },\n      /**\n       * A record consisting of data about a primitive value that could be\n       * consolidated.\n       * @constructor\n       * @nosideeffects\n       */\n      TPrimitiveValue = function() {\n        /**\n         * The difference in the number of terminal symbols between the original\n         * source text and the one with the primitive value consolidated. If the\n         * difference is positive, the primitive value is considered worthwhile.\n         * @type {number}\n         */\n        this.nSaving = 0;\n        /**\n         * An identifier name of the variable that will be declared and assigned\n         * the primitive value if the primitive value is consolidated.\n         * @type {string}\n         */\n        this.sName = '';\n      },\n      /**\n       * A record consisting of data on what to consolidate within the range of\n       * source elements that is currently being considered.\n       * @constructor\n       * @nosideeffects\n       */\n      TSolution = function() {\n        /**\n         * An object whose keys are prefixed representation Strings of each\n         * primitive value that could be consolidated within the elements and\n         * whose values are corresponding data about those primitive values.\n         * @type {!Object.<string, {nSaving: number, sName: string}>}\n         * @see TPrimitiveValue\n         */\n        this.oPrimitiveValues = {};\n        /**\n         * The difference in the number of terminal symbols between the original\n         * source text and the one with all the worthwhile primitive values\n         * consolidated.\n         * @type {number}\n         * @see TPrimitiveValue#nSaving\n         */\n        this.nSavings = 0;\n      },\n      /**\n       * The processor of <abbr title=\"abstract syntax tree\">AST</abbr>s found\n       * in UglifyJS.\n       * @namespace\n       * @type {!TProcessor}\n       */\n      oProcessor = (/** @type {!TProcessor} */ require('./process')),\n      /**\n       * A record consisting of a number of constants that represent the\n       * difference in the number of terminal symbols between a source text with\n       * a modified syntactic code unit and the original one.\n       * @namespace\n       * @type {!Object.<string, number>}\n       */\n      oWeights = {\n        /**\n         * The difference in the number of punctuators required by the bracket\n         * notation and the dot notation.\n         * <p><code>'[]'.length - '.'.length</code></p>\n         * @const\n         * @type {number}\n         */\n        N_PROPERTY_ACCESSOR: 1,\n        /**\n         * The number of punctuators required by a variable declaration with an\n         * initialiser.\n         * <p><code>':'.length + ';'.length</code></p>\n         * @const\n         * @type {number}\n         */\n        N_VARIABLE_DECLARATION: 2,\n        /**\n         * The number of terminal symbols required to introduce a variable\n         * statement (excluding its variable declaration list).\n         * <p><code>'var '.length</code></p>\n         * @const\n         * @type {number}\n         */\n        N_VARIABLE_STATEMENT_AFFIXATION: 4,\n        /**\n         * The number of terminal symbols needed to enclose source elements\n         * within a function call with no argument values to a function with an\n         * empty parameter list.\n         * <p><code>'(function(){}());'.length</code></p>\n         * @const\n         * @type {number}\n         */\n        N_CLOSURE: 17\n      },\n      /**\n       * Categories of primary expressions from which primitive values that\n       * could be consolidated are derivable.\n       * @namespace\n       * @enum {number}\n       */\n      EPrimaryExpressionCategories = {\n        /**\n         * Identifier names used as property accessors.\n         * @type {number}\n         */\n        N_IDENTIFIER_NAMES: 0,\n        /**\n         * String literals.\n         * @type {number}\n         */\n        N_STRING_LITERALS: 1,\n        /**\n         * Null and Boolean literals.\n         * @type {number}\n         */\n        N_NULL_AND_BOOLEAN_LITERALS: 2\n      },\n      /**\n       * Prefixes of primitive values that could be consolidated.\n       * The String values of the prefixes must have same number of characters.\n       * The prefixes must not be used in any properties defined in any version\n       * of <a href=\n       * \"http://www.ecma-international.org/publications/standards/Ecma-262.htm\"\n       * >ECMA-262</a>.\n       * @namespace\n       * @enum {string}\n       */\n      EValuePrefixes = {\n        /**\n         * Identifies String values.\n         * @type {string}\n         */\n        S_STRING: '#S',\n        /**\n         * Identifies null and Boolean values.\n         * @type {string}\n         */\n        S_SYMBOLIC: '#O'\n      },\n      /**\n       * Categories of source elements in terms of their appropriateness of\n       * having their primitive values consolidated.\n       * @namespace\n       * @enum {number}\n       */\n      ESourceElementCategories = {\n        /**\n         * Identifies a source element that includes the <a href=\n         * \"http://es5.github.com/#x12.10\">{@code with}</a> statement.\n         * @type {number}\n         */\n        N_WITH: 0,\n        /**\n         * Identifies a source element that includes the <a href=\n         * \"http://es5.github.com/#x15.1.2.1\">{@code eval}</a> identifier name.\n         * @type {number}\n         */\n        N_EVAL: 1,\n        /**\n         * Identifies a source element that must be excluded from the process\n         * unless its whole scope is examined.\n         * @type {number}\n         */\n        N_EXCLUDABLE: 2,\n        /**\n         * Identifies source elements not posing any problems.\n         * @type {number}\n         */\n        N_OTHER: 3\n      },\n      /**\n       * The list of literals (other than the String ones) whose primitive\n       * values can be consolidated.\n       * @const\n       * @type {!Array.<string>}\n       */\n      A_OTHER_SUBSTITUTABLE_LITERALS = [\n        'null',   // The null literal.\n        'false',  // The Boolean literal {@code false}.\n        'true'    // The Boolean literal {@code true}.\n      ];\n\n  (/**\n    * Consolidates all worthwhile primitive values in a syntactic code unit.\n    * @param {!TSyntacticCodeUnit} oSyntacticCodeUnit An array-like object\n    *     representing the branch of the abstract syntax tree representing the\n    *     syntactic code unit along with its scope.\n    * @see TPrimitiveValue#nSaving\n    */\n   function fExamineSyntacticCodeUnit(oSyntacticCodeUnit) {\n     var _,\n         /**\n          * Indicates whether the syntactic code unit represents global code.\n          * @type {boolean}\n          */\n         bIsGlobal = 'toplevel' === oSyntacticCodeUnit[0],\n         /**\n          * Indicates whether the whole scope is being examined.\n          * @type {boolean}\n          */\n         bIsWhollyExaminable = !bIsGlobal,\n         /**\n          * An array-like object representing source elements that constitute a\n          * syntactic code unit.\n          * @type {!TSyntacticCodeUnit}\n          */\n         oSourceElements,\n         /**\n          * A record consisting of data about the source element that is\n          * currently being examined.\n          * @type {!TSourceElementsData}\n          */\n         oSourceElementData,\n         /**\n          * The scope of the syntactic code unit.\n          * @type {!TScope}\n          */\n         oScope,\n         /**\n          * An instance of an object that allows the traversal of an <abbr\n          * title=\"abstract syntax tree\">AST</abbr>.\n          * @type {!TWalker}\n          */\n         oWalker,\n         /**\n          * An object encompassing collections of functions used during the\n          * traversal of an <abbr title=\"abstract syntax tree\">AST</abbr>.\n          * @namespace\n          * @type {!Object.<string, !Object.<string, function(...[*])>>}\n          */\n         oWalkers = {\n           /**\n            * A collection of functions used during the surveyance of source\n            * elements.\n            * @namespace\n            * @type {!Object.<string, function(...[*])>}\n            */\n           oSurveySourceElement: {\n             /**#nocode+*/  // JsDoc Toolkit 2.4.0 hides some of the keys.\n             /**\n              * Classifies the source element as excludable if it does not\n              * contain a {@code with} statement or the {@code eval} identifier\n              * name. Adds the identifier of the function and its formal\n              * parameters to the list of identifier names found.\n              * @param {string} sIdentifier The identifier of the function.\n              * @param {!Array.<string>} aFormalParameterList Formal parameters.\n              * @param {!TSyntacticCodeUnit} oFunctionBody Function code.\n              */\n             'defun': function(\n                 sIdentifier,\n                 aFormalParameterList,\n                 oFunctionBody) {\n               fClassifyAsExcludable();\n               fAddIdentifier(sIdentifier);\n               aFormalParameterList.forEach(fAddIdentifier);\n             },\n             /**\n              * Increments the count of the number of occurrences of the String\n              * value that is equivalent to the sequence of terminal symbols\n              * that constitute the encountered identifier name.\n              * @param {!TSyntacticCodeUnit} oExpression The nonterminal\n              *     MemberExpression.\n              * @param {string} sIdentifierName The identifier name used as the\n              *     property accessor.\n              * @return {!Array} The encountered branch of an <abbr title=\n              *     \"abstract syntax tree\">AST</abbr> with its nonterminal\n              *     MemberExpression traversed.\n              */\n             'dot': function(oExpression, sIdentifierName) {\n               fCountPrimaryExpression(\n                   EPrimaryExpressionCategories.N_IDENTIFIER_NAMES,\n                   EValuePrefixes.S_STRING + sIdentifierName);\n               return ['dot', oWalker.walk(oExpression), sIdentifierName];\n             },\n             /**\n              * Adds the optional identifier of the function and its formal\n              * parameters to the list of identifier names found.\n              * @param {?string} sIdentifier The optional identifier of the\n              *     function.\n              * @param {!Array.<string>} aFormalParameterList Formal parameters.\n              * @param {!TSyntacticCodeUnit} oFunctionBody Function code.\n              */\n             'function': function(\n                 sIdentifier,\n                 aFormalParameterList,\n                 oFunctionBody) {\n               if ('string' === typeof sIdentifier) {\n                 fAddIdentifier(sIdentifier);\n               }\n               aFormalParameterList.forEach(fAddIdentifier);\n             },\n             /**\n              * Either increments the count of the number of occurrences of the\n              * encountered null or Boolean value or classifies a source element\n              * as containing the {@code eval} identifier name.\n              * @param {string} sIdentifier The identifier encountered.\n              */\n             'name': function(sIdentifier) {\n               if (-1 !== A_OTHER_SUBSTITUTABLE_LITERALS.indexOf(sIdentifier)) {\n                 fCountPrimaryExpression(\n                     EPrimaryExpressionCategories.N_NULL_AND_BOOLEAN_LITERALS,\n                     EValuePrefixes.S_SYMBOLIC + sIdentifier);\n               } else {\n                 if ('eval' === sIdentifier) {\n                   oSourceElementData.nCategory =\n                       ESourceElementCategories.N_EVAL;\n                 }\n                 fAddIdentifier(sIdentifier);\n               }\n             },\n             /**\n              * Classifies the source element as excludable if it does not\n              * contain a {@code with} statement or the {@code eval} identifier\n              * name.\n              * @param {TSyntacticCodeUnit} oExpression The expression whose\n              *     value is to be returned.\n              */\n             'return': function(oExpression) {\n               fClassifyAsExcludable();\n             },\n             /**\n              * Increments the count of the number of occurrences of the\n              * encountered String value.\n              * @param {string} sStringValue The String value of the string\n              *     literal encountered.\n              */\n             'string': function(sStringValue) {\n               if (sStringValue.length > 0) {\n                 fCountPrimaryExpression(\n                     EPrimaryExpressionCategories.N_STRING_LITERALS,\n                     EValuePrefixes.S_STRING + sStringValue);\n               }\n             },\n             /**\n              * Adds the identifier reserved for an exception to the list of\n              * identifier names found.\n              * @param {!TSyntacticCodeUnit} oTry A block of code in which an\n              *     exception can occur.\n              * @param {Array} aCatch The identifier reserved for an exception\n              *     and a block of code to handle the exception.\n              * @param {TSyntacticCodeUnit} oFinally An optional block of code\n              *     to be evaluated regardless of whether an exception occurs.\n              */\n             'try': function(oTry, aCatch, oFinally) {\n               if (Array.isArray(aCatch)) {\n                 fAddIdentifier(aCatch[0]);\n               }\n             },\n             /**\n              * Classifies the source element as excludable if it does not\n              * contain a {@code with} statement or the {@code eval} identifier\n              * name. Adds the identifier of each declared variable to the list\n              * of identifier names found.\n              * @param {!Array.<!Array>} aVariableDeclarationList Variable\n              *     declarations.\n              */\n             'var': function(aVariableDeclarationList) {\n               fClassifyAsExcludable();\n               aVariableDeclarationList.forEach(fAddVariable);\n             },\n             /**\n              * Classifies a source element as containing the {@code with}\n              * statement.\n              * @param {!TSyntacticCodeUnit} oExpression An expression whose\n              *     value is to be converted to a value of type Object and\n              *     become the binding object of a new object environment\n              *     record of a new lexical environment in which the statement\n              *     is to be executed.\n              * @param {!TSyntacticCodeUnit} oStatement The statement to be\n              *     executed in the augmented lexical environment.\n              * @return {!Array} An empty array to stop the traversal.\n              */\n             'with': function(oExpression, oStatement) {\n               oSourceElementData.nCategory = ESourceElementCategories.N_WITH;\n               return [];\n             }\n             /**#nocode-*/  // JsDoc Toolkit 2.4.0 hides some of the keys.\n           },\n           /**\n            * A collection of functions used while looking for nested functions.\n            * @namespace\n            * @type {!Object.<string, function(...[*])>}\n            */\n           oExamineFunctions: {\n             /**#nocode+*/  // JsDoc Toolkit 2.4.0 hides some of the keys.\n             /**\n              * Orders an examination of a nested function declaration.\n              * @this {!TSyntacticCodeUnit} An array-like object representing\n              *     the branch of an <abbr title=\"abstract syntax tree\"\n              *     >AST</abbr> representing the syntactic code unit along with\n              *     its scope.\n              * @return {!Array} An empty array to stop the traversal.\n              */\n             'defun': function() {\n               fExamineSyntacticCodeUnit(this);\n               return [];\n             },\n             /**\n              * Orders an examination of a nested function expression.\n              * @this {!TSyntacticCodeUnit} An array-like object representing\n              *     the branch of an <abbr title=\"abstract syntax tree\"\n              *     >AST</abbr> representing the syntactic code unit along with\n              *     its scope.\n              * @return {!Array} An empty array to stop the traversal.\n              */\n             'function': function() {\n               fExamineSyntacticCodeUnit(this);\n               return [];\n             }\n             /**#nocode-*/  // JsDoc Toolkit 2.4.0 hides some of the keys.\n           }\n         },\n         /**\n          * Records containing data about source elements.\n          * @type {Array.<TSourceElementsData>}\n          */\n         aSourceElementsData = [],\n         /**\n          * The index (in the source text order) of the source element\n          * immediately following a <a href=\"http://es5.github.com/#x14.1\"\n          * >Directive Prologue</a>.\n          * @type {number}\n          */\n         nAfterDirectivePrologue = 0,\n         /**\n          * The index (in the source text order) of the source element that is\n          * currently being considered.\n          * @type {number}\n          */\n         nPosition,\n         /**\n          * The index (in the source text order) of the source element that is\n          * the last element of the range of source elements that is currently\n          * being considered.\n          * @type {(undefined|number)}\n          */\n         nTo,\n         /**\n          * Initiates the traversal of a source element.\n          * @param {!TWalker} oWalker An instance of an object that allows the\n          *     traversal of an abstract syntax tree.\n          * @param {!TSyntacticCodeUnit} oSourceElement A source element from\n          *     which the traversal should commence.\n          * @return {function(): !TSyntacticCodeUnit} A function that is able to\n          *     initiate the traversal from a given source element.\n          */\n         cContext = function(oWalker, oSourceElement) {\n           /**\n            * @return {!TSyntacticCodeUnit} A function that is able to\n            *     initiate the traversal from a given source element.\n            */\n           var fLambda = function() {\n             return oWalker.walk(oSourceElement);\n           };\n\n           return fLambda;\n         },\n         /**\n          * Classifies the source element as excludable if it does not\n          * contain a {@code with} statement or the {@code eval} identifier\n          * name.\n          */\n         fClassifyAsExcludable = function() {\n           if (oSourceElementData.nCategory ===\n               ESourceElementCategories.N_OTHER) {\n             oSourceElementData.nCategory =\n                 ESourceElementCategories.N_EXCLUDABLE;\n           }\n         },\n         /**\n          * Adds an identifier to the list of identifier names found.\n          * @param {string} sIdentifier The identifier to be added.\n          */\n         fAddIdentifier = function(sIdentifier) {\n           if (-1 === oSourceElementData.aIdentifiers.indexOf(sIdentifier)) {\n             oSourceElementData.aIdentifiers.push(sIdentifier);\n           }\n         },\n         /**\n          * Adds the identifier of a variable to the list of identifier names\n          * found.\n          * @param {!Array} aVariableDeclaration A variable declaration.\n          */\n         fAddVariable = function(aVariableDeclaration) {\n           fAddIdentifier(/** @type {string} */ aVariableDeclaration[0]);\n         },\n         /**\n          * Increments the count of the number of occurrences of the prefixed\n          * String representation attributed to the primary expression.\n          * @param {number} nCategory The category of the primary expression.\n          * @param {string} sName The prefixed String representation attributed\n          *     to the primary expression.\n          */\n         fCountPrimaryExpression = function(nCategory, sName) {\n           if (!oSourceElementData.aCount[nCategory].hasOwnProperty(sName)) {\n             oSourceElementData.aCount[nCategory][sName] = 0;\n             if (-1 === oSourceElementData.aPrimitiveValues.indexOf(sName)) {\n               oSourceElementData.aPrimitiveValues.push(sName);\n             }\n           }\n           oSourceElementData.aCount[nCategory][sName] += 1;\n         },\n         /**\n          * Consolidates all worthwhile primitive values in a range of source\n          *     elements.\n          * @param {number} nFrom The index (in the source text order) of the\n          *     source element that is the first element of the range.\n          * @param {number} nTo The index (in the source text order) of the\n          *     source element that is the last element of the range.\n          * @param {boolean} bEnclose Indicates whether the range should be\n          *     enclosed within a function call with no argument values to a\n          *     function with an empty parameter list if any primitive values\n          *     are consolidated.\n          * @see TPrimitiveValue#nSaving\n          */\n         fExamineSourceElements = function(nFrom, nTo, bEnclose) {\n           var _,\n               /**\n                * The index of the last mangled name.\n                * @type {number}\n                */\n               nIndex = oScope.cname,\n               /**\n                * The index of the source element that is currently being\n                * considered.\n                * @type {number}\n                */\n               nPosition,\n               /**\n                * A collection of functions used during the consolidation of\n                * primitive values and identifier names used as property\n                * accessors.\n                * @namespace\n                * @type {!Object.<string, function(...[*])>}\n                */\n               oWalkersTransformers = {\n                 /**\n                  * If the String value that is equivalent to the sequence of\n                  * terminal symbols that constitute the encountered identifier\n                  * name is worthwhile, a syntactic conversion from the dot\n                  * notation to the bracket notation ensues with that sequence\n                  * being substituted by an identifier name to which the value\n                  * is assigned.\n                  * Applies to property accessors that use the dot notation.\n                  * @param {!TSyntacticCodeUnit} oExpression The nonterminal\n                  *     MemberExpression.\n                  * @param {string} sIdentifierName The identifier name used as\n                  *     the property accessor.\n                  * @return {!Array} A syntactic code unit that is equivalent to\n                  *     the one encountered.\n                  * @see TPrimitiveValue#nSaving\n                  */\n                 'dot': function(oExpression, sIdentifierName) {\n                   /**\n                    * The prefixed String value that is equivalent to the\n                    * sequence of terminal symbols that constitute the\n                    * encountered identifier name.\n                    * @type {string}\n                    */\n                   var sPrefixed = EValuePrefixes.S_STRING + sIdentifierName;\n\n                   return oSolutionBest.oPrimitiveValues.hasOwnProperty(\n                       sPrefixed) &&\n                       oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0 ?\n                       ['sub',\n                        oWalker.walk(oExpression),\n                        ['name',\n                         oSolutionBest.oPrimitiveValues[sPrefixed].sName]] :\n                       ['dot', oWalker.walk(oExpression), sIdentifierName];\n                 },\n                 /**\n                  * If the encountered identifier is a null or Boolean literal\n                  * and its value is worthwhile, the identifier is substituted\n                  * by an identifier name to which that value is assigned.\n                  * Applies to identifier names.\n                  * @param {string} sIdentifier The identifier encountered.\n                  * @return {!Array} A syntactic code unit that is equivalent to\n                  *     the one encountered.\n                  * @see TPrimitiveValue#nSaving\n                  */\n                 'name': function(sIdentifier) {\n                   /**\n                    * The prefixed representation String of the identifier.\n                    * @type {string}\n                    */\n                   var sPrefixed = EValuePrefixes.S_SYMBOLIC + sIdentifier;\n\n                   return [\n                     'name',\n                     oSolutionBest.oPrimitiveValues.hasOwnProperty(sPrefixed) &&\n                     oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0 ?\n                     oSolutionBest.oPrimitiveValues[sPrefixed].sName :\n                     sIdentifier\n                   ];\n                 },\n                 /**\n                  * If the encountered String value is worthwhile, it is\n                  * substituted by an identifier name to which that value is\n                  * assigned.\n                  * Applies to String values.\n                  * @param {string} sStringValue The String value of the string\n                  *     literal encountered.\n                  * @return {!Array} A syntactic code unit that is equivalent to\n                  *     the one encountered.\n                  * @see TPrimitiveValue#nSaving\n                  */\n                 'string': function(sStringValue) {\n                   /**\n                    * The prefixed representation String of the primitive value\n                    * of the literal.\n                    * @type {string}\n                    */\n                   var sPrefixed =\n                       EValuePrefixes.S_STRING + sStringValue;\n\n                   return oSolutionBest.oPrimitiveValues.hasOwnProperty(\n                       sPrefixed) &&\n                       oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0 ?\n                       ['name',\n                        oSolutionBest.oPrimitiveValues[sPrefixed].sName] :\n                       ['string', sStringValue];\n                 }\n               },\n               /**\n                * Such data on what to consolidate within the range of source\n                * elements that is currently being considered that lead to the\n                * greatest known reduction of the number of the terminal symbols\n                * in comparison to the original source text.\n                * @type {!TSolution}\n                */\n               oSolutionBest = new TSolution(),\n               /**\n                * Data representing an ongoing attempt to find a better\n                * reduction of the number of the terminal symbols in comparison\n                * to the original source text than the best one that is\n                * currently known.\n                * @type {!TSolution}\n                * @see oSolutionBest\n                */\n               oSolutionCandidate = new TSolution(),\n               /**\n                * A record consisting of data about the range of source elements\n                * that is currently being examined.\n                * @type {!TSourceElementsData}\n                */\n               oSourceElementsData = new TSourceElementsData(),\n               /**\n                * Variable declarations for each primitive value that is to be\n                * consolidated within the elements.\n                * @type {!Array.<!Array>}\n                */\n               aVariableDeclarations = [],\n               /**\n                * Augments a list with a prefixed representation String.\n                * @param {!Array.<string>} aList A list that is to be augmented.\n                * @return {function(string)} A function that augments a list\n                *     with a prefixed representation String.\n                */\n               cAugmentList = function(aList) {\n                 /**\n                  * @param {string} sPrefixed Prefixed representation String of\n                  *     a primitive value that could be consolidated within the\n                  *     elements.\n                  */\n                 var fLambda = function(sPrefixed) {\n                   if (-1 === aList.indexOf(sPrefixed)) {\n                     aList.push(sPrefixed);\n                   }\n                 };\n\n                 return fLambda;\n               },\n               /**\n                * Adds the number of occurrences of a primitive value of a given\n                * category that could be consolidated in the source element with\n                * a given index to the count of occurrences of that primitive\n                * value within the range of source elements that is currently\n                * being considered.\n                * @param {number} nPosition The index (in the source text order)\n                *     of a source element.\n                * @param {number} nCategory The category of the primary\n                *     expression from which the primitive value is derived.\n                * @return {function(string)} A function that performs the\n                *     addition.\n                * @see cAddOccurrencesInCategory\n                */\n               cAddOccurrences = function(nPosition, nCategory) {\n                 /**\n                  * @param {string} sPrefixed The prefixed representation String\n                  *     of a primitive value.\n                  */\n                 var fLambda = function(sPrefixed) {\n                   if (!oSourceElementsData.aCount[nCategory].hasOwnProperty(\n                           sPrefixed)) {\n                     oSourceElementsData.aCount[nCategory][sPrefixed] = 0;\n                   }\n                   oSourceElementsData.aCount[nCategory][sPrefixed] +=\n                       aSourceElementsData[nPosition].aCount[nCategory][\n                           sPrefixed];\n                 };\n\n                 return fLambda;\n               },\n               /**\n                * Adds the number of occurrences of each primitive value of a\n                * given category that could be consolidated in the source\n                * element with a given index to the count of occurrences of that\n                * primitive values within the range of source elements that is\n                * currently being considered.\n                * @param {number} nPosition The index (in the source text order)\n                *     of a source element.\n                * @return {function(number)} A function that performs the\n                *     addition.\n                * @see fAddOccurrences\n                */\n               cAddOccurrencesInCategory = function(nPosition) {\n                 /**\n                  * @param {number} nCategory The category of the primary\n                  *     expression from which the primitive value is derived.\n                  */\n                 var fLambda = function(nCategory) {\n                   Object.keys(\n                       aSourceElementsData[nPosition].aCount[nCategory]\n                   ).forEach(cAddOccurrences(nPosition, nCategory));\n                 };\n\n                 return fLambda;\n               },\n               /**\n                * Adds the number of occurrences of each primitive value that\n                * could be consolidated in the source element with a given index\n                * to the count of occurrences of that primitive values within\n                * the range of source elements that is currently being\n                * considered.\n                * @param {number} nPosition The index (in the source text order)\n                *     of a source element.\n                */\n               fAddOccurrences = function(nPosition) {\n                 Object.keys(aSourceElementsData[nPosition].aCount).forEach(\n                     cAddOccurrencesInCategory(nPosition));\n               },\n               /**\n                * Creates a variable declaration for a primitive value if that\n                * primitive value is to be consolidated within the elements.\n                * @param {string} sPrefixed Prefixed representation String of a\n                *     primitive value that could be consolidated within the\n                *     elements.\n                * @see aVariableDeclarations\n                */\n               cAugmentVariableDeclarations = function(sPrefixed) {\n                 if (oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0) {\n                   aVariableDeclarations.push([\n                     oSolutionBest.oPrimitiveValues[sPrefixed].sName,\n                     [0 === sPrefixed.indexOf(EValuePrefixes.S_SYMBOLIC) ?\n                      'name' : 'string',\n                      sPrefixed.substring(EValuePrefixes.S_SYMBOLIC.length)]\n                   ]);\n                 }\n               },\n               /**\n                * Sorts primitive values with regard to the difference in the\n                * number of terminal symbols between the original source text\n                * and the one with those primitive values consolidated.\n                * @param {string} sPrefixed0 The prefixed representation String\n                *     of the first of the two primitive values that are being\n                *     compared.\n                * @param {string} sPrefixed1 The prefixed representation String\n                *     of the second of the two primitive values that are being\n                *     compared.\n                * @return {number}\n                *     <dl>\n                *         <dt>-1</dt>\n                *         <dd>if the first primitive value must be placed before\n                *              the other one,</dd>\n                *         <dt>0</dt>\n                *         <dd>if the first primitive value may be placed before\n                *              the other one,</dd>\n                *         <dt>1</dt>\n                *         <dd>if the first primitive value must not be placed\n                *              before the other one.</dd>\n                *     </dl>\n                * @see TSolution.oPrimitiveValues\n                */\n               cSortPrimitiveValues = function(sPrefixed0, sPrefixed1) {\n                 /**\n                  * The difference between:\n                  * <ol>\n                  * <li>the difference in the number of terminal symbols\n                  *     between the original source text and the one with the\n                  *     first primitive value consolidated, and</li>\n                  * <li>the difference in the number of terminal symbols\n                  *     between the original source text and the one with the\n                  *     second primitive value consolidated.</li>\n                  * </ol>\n                  * @type {number}\n                  */\n                 var nDifference =\n                     oSolutionCandidate.oPrimitiveValues[sPrefixed0].nSaving -\n                     oSolutionCandidate.oPrimitiveValues[sPrefixed1].nSaving;\n\n                 return nDifference > 0 ? -1 : nDifference < 0 ? 1 : 0;\n               },\n               /**\n                * Assigns an identifier name to a primitive value and calculates\n                * whether instances of that primitive value are worth\n                * consolidating.\n                * @param {string} sPrefixed The prefixed representation String\n                *     of a primitive value that is being evaluated.\n                */\n               fEvaluatePrimitiveValue = function(sPrefixed) {\n                 var _,\n                     /**\n                      * The index of the last mangled name.\n                      * @type {number}\n                      */\n                     nIndex,\n                     /**\n                      * The representation String of the primitive value that is\n                      * being evaluated.\n                      * @type {string}\n                      */\n                     sName =\n                         sPrefixed.substring(EValuePrefixes.S_SYMBOLIC.length),\n                     /**\n                      * The number of source characters taken up by the\n                      * representation String of the primitive value that is\n                      * being evaluated.\n                      * @type {number}\n                      */\n                     nLengthOriginal = sName.length,\n                     /**\n                      * The number of source characters taken up by the\n                      * identifier name that could substitute the primitive\n                      * value that is being evaluated.\n                      * substituted.\n                      * @type {number}\n                      */\n                     nLengthSubstitution,\n                     /**\n                      * The number of source characters taken up by by the\n                      * representation String of the primitive value that is\n                      * being evaluated when it is represented by a string\n                      * literal.\n                      * @type {number}\n                      */\n                     nLengthString = oProcessor.make_string(sName).length;\n\n                 oSolutionCandidate.oPrimitiveValues[sPrefixed] =\n                     new TPrimitiveValue();\n                 do {  // Find an identifier unused in this or any nested scope.\n                   nIndex = oScope.cname;\n                   oSolutionCandidate.oPrimitiveValues[sPrefixed].sName =\n                       oScope.next_mangled();\n                 } while (-1 !== oSourceElementsData.aIdentifiers.indexOf(\n                     oSolutionCandidate.oPrimitiveValues[sPrefixed].sName));\n                 nLengthSubstitution = oSolutionCandidate.oPrimitiveValues[\n                     sPrefixed].sName.length;\n                 if (0 === sPrefixed.indexOf(EValuePrefixes.S_SYMBOLIC)) {\n                   // foo:null, or foo:null;\n                   oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving -=\n                       nLengthSubstitution + nLengthOriginal +\n                       oWeights.N_VARIABLE_DECLARATION;\n                   // null vs foo\n                   oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving +=\n                       oSourceElementsData.aCount[\n                           EPrimaryExpressionCategories.\n                               N_NULL_AND_BOOLEAN_LITERALS][sPrefixed] *\n                       (nLengthOriginal - nLengthSubstitution);\n                 } else {\n                   // foo:'fromCharCode';\n                   oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving -=\n                       nLengthSubstitution + nLengthString +\n                       oWeights.N_VARIABLE_DECLARATION;\n                   // .fromCharCode vs [foo]\n                   if (oSourceElementsData.aCount[\n                           EPrimaryExpressionCategories.N_IDENTIFIER_NAMES\n                       ].hasOwnProperty(sPrefixed)) {\n                     oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving +=\n                         oSourceElementsData.aCount[\n                             EPrimaryExpressionCategories.N_IDENTIFIER_NAMES\n                         ][sPrefixed] *\n                         (nLengthOriginal - nLengthSubstitution -\n                          oWeights.N_PROPERTY_ACCESSOR);\n                   }\n                   // 'fromCharCode' vs foo\n                   if (oSourceElementsData.aCount[\n                           EPrimaryExpressionCategories.N_STRING_LITERALS\n                       ].hasOwnProperty(sPrefixed)) {\n                     oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving +=\n                         oSourceElementsData.aCount[\n                             EPrimaryExpressionCategories.N_STRING_LITERALS\n                         ][sPrefixed] *\n                         (nLengthString - nLengthSubstitution);\n                   }\n                 }\n                 if (oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving >\n                     0) {\n                   oSolutionCandidate.nSavings +=\n                       oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving;\n                 } else {\n                   oScope.cname = nIndex; // Free the identifier name.\n                 }\n               },\n               /**\n                * Adds a variable declaration to an existing variable statement.\n                * @param {!Array} aVariableDeclaration A variable declaration\n                *     with an initialiser.\n                */\n               cAddVariableDeclaration = function(aVariableDeclaration) {\n                 (/** @type {!Array} */ oSourceElements[nFrom][1]).unshift(\n                     aVariableDeclaration);\n               };\n\n           if (nFrom > nTo) {\n             return;\n           }\n           // If the range is a closure, reuse the closure.\n           if (nFrom === nTo &&\n               'stat' === oSourceElements[nFrom][0] &&\n               'call' === oSourceElements[nFrom][1][0] &&\n               'function' === oSourceElements[nFrom][1][1][0]) {\n             fExamineSyntacticCodeUnit(oSourceElements[nFrom][1][1]);\n             return;\n           }\n           // Create a list of all derived primitive values within the range.\n           for (nPosition = nFrom; nPosition <= nTo; nPosition += 1) {\n             aSourceElementsData[nPosition].aPrimitiveValues.forEach(\n                 cAugmentList(oSourceElementsData.aPrimitiveValues));\n           }\n           if (0 === oSourceElementsData.aPrimitiveValues.length) {\n             return;\n           }\n           for (nPosition = nFrom; nPosition <= nTo; nPosition += 1) {\n             // Add the number of occurrences to the total count.\n             fAddOccurrences(nPosition);\n             // Add identifiers of this or any nested scope to the list.\n             aSourceElementsData[nPosition].aIdentifiers.forEach(\n                 cAugmentList(oSourceElementsData.aIdentifiers));\n           }\n           // Distribute identifier names among derived primitive values.\n           do {  // If there was any progress, find a better distribution.\n             oSolutionBest = oSolutionCandidate;\n             if (Object.keys(oSolutionCandidate.oPrimitiveValues).length > 0) {\n               // Sort primitive values descending by their worthwhileness.\n               oSourceElementsData.aPrimitiveValues.sort(cSortPrimitiveValues);\n             }\n             oSolutionCandidate = new TSolution();\n             oSourceElementsData.aPrimitiveValues.forEach(\n                 fEvaluatePrimitiveValue);\n             oScope.cname = nIndex;\n           } while (oSolutionCandidate.nSavings > oSolutionBest.nSavings);\n           // Take the necessity of adding a variable statement into account.\n           if ('var' !== oSourceElements[nFrom][0]) {\n             oSolutionBest.nSavings -= oWeights.N_VARIABLE_STATEMENT_AFFIXATION;\n           }\n           if (bEnclose) {\n             // Take the necessity of forming a closure into account.\n             oSolutionBest.nSavings -= oWeights.N_CLOSURE;\n           }\n           if (oSolutionBest.nSavings > 0) {\n             // Create variable declarations suitable for UglifyJS.\n             Object.keys(oSolutionBest.oPrimitiveValues).forEach(\n                 cAugmentVariableDeclarations);\n             // Rewrite expressions that contain worthwhile primitive values.\n             for (nPosition = nFrom; nPosition <= nTo; nPosition += 1) {\n               oWalker = oProcessor.ast_walker();\n               oSourceElements[nPosition] =\n                   oWalker.with_walkers(\n                       oWalkersTransformers,\n                       cContext(oWalker, oSourceElements[nPosition]));\n             }\n             if ('var' === oSourceElements[nFrom][0]) {  // Reuse the statement.\n               (/** @type {!Array.<!Array>} */ aVariableDeclarations.reverse(\n                   )).forEach(cAddVariableDeclaration);\n             } else {  // Add a variable statement.\n               Array.prototype.splice.call(\n                   oSourceElements,\n                   nFrom,\n                   0,\n                   ['var', aVariableDeclarations]);\n               nTo += 1;\n             }\n             if (bEnclose) {\n               // Add a closure.\n               Array.prototype.splice.call(\n                   oSourceElements,\n                   nFrom,\n                   0,\n                   ['stat', ['call', ['function', null, [], []], []]]);\n               // Copy source elements into the closure.\n               for (nPosition = nTo + 1; nPosition > nFrom; nPosition -= 1) {\n                 Array.prototype.unshift.call(\n                     oSourceElements[nFrom][1][1][3],\n                     oSourceElements[nPosition]);\n               }\n               // Remove source elements outside the closure.\n               Array.prototype.splice.call(\n                   oSourceElements,\n                   nFrom + 1,\n                   nTo - nFrom + 1);\n             }\n           }\n           if (bEnclose) {\n             // Restore the availability of identifier names.\n             oScope.cname = nIndex;\n           }\n         };\n\n     oSourceElements = (/** @type {!TSyntacticCodeUnit} */\n         oSyntacticCodeUnit[bIsGlobal ? 1 : 3]);\n     if (0 === oSourceElements.length) {\n       return;\n     }\n     oScope = bIsGlobal ? oSyntacticCodeUnit.scope : oSourceElements.scope;\n     // Skip a Directive Prologue.\n     while (nAfterDirectivePrologue < oSourceElements.length &&\n            'directive' === oSourceElements[nAfterDirectivePrologue][0]) {\n       nAfterDirectivePrologue += 1;\n       aSourceElementsData.push(null);\n     }\n     if (oSourceElements.length === nAfterDirectivePrologue) {\n       return;\n     }\n     for (nPosition = nAfterDirectivePrologue;\n          nPosition < oSourceElements.length;\n          nPosition += 1) {\n       oSourceElementData = new TSourceElementsData();\n       oWalker = oProcessor.ast_walker();\n       // Classify a source element.\n       // Find its derived primitive values and count their occurrences.\n       // Find all identifiers used (including nested scopes).\n       oWalker.with_walkers(\n           oWalkers.oSurveySourceElement,\n           cContext(oWalker, oSourceElements[nPosition]));\n       // Establish whether the scope is still wholly examinable.\n       bIsWhollyExaminable = bIsWhollyExaminable &&\n           ESourceElementCategories.N_WITH !== oSourceElementData.nCategory &&\n           ESourceElementCategories.N_EVAL !== oSourceElementData.nCategory;\n       aSourceElementsData.push(oSourceElementData);\n     }\n     if (bIsWhollyExaminable) {  // Examine the whole scope.\n       fExamineSourceElements(\n           nAfterDirectivePrologue,\n           oSourceElements.length - 1,\n           false);\n     } else {  // Examine unexcluded ranges of source elements.\n       for (nPosition = oSourceElements.length - 1;\n            nPosition >= nAfterDirectivePrologue;\n            nPosition -= 1) {\n         oSourceElementData = (/** @type {!TSourceElementsData} */\n             aSourceElementsData[nPosition]);\n         if (ESourceElementCategories.N_OTHER ===\n             oSourceElementData.nCategory) {\n           if ('undefined' === typeof nTo) {\n             nTo = nPosition;  // Indicate the end of a range.\n           }\n           // Examine the range if it immediately follows a Directive Prologue.\n           if (nPosition === nAfterDirectivePrologue) {\n             fExamineSourceElements(nPosition, nTo, true);\n           }\n         } else {\n           if ('undefined' !== typeof nTo) {\n             // Examine the range that immediately follows this source element.\n             fExamineSourceElements(nPosition + 1, nTo, true);\n             nTo = void 0;  // Obliterate the range.\n           }\n           // Examine nested functions.\n           oWalker = oProcessor.ast_walker();\n           oWalker.with_walkers(\n               oWalkers.oExamineFunctions,\n               cContext(oWalker, oSourceElements[nPosition]));\n         }\n       }\n     }\n   }(oAbstractSyntaxTree = oProcessor.ast_add_scope(oAbstractSyntaxTree)));\n  return oAbstractSyntaxTree;\n};\n/*jshint sub:false */\n\n/* Local Variables:      */\n/* mode: js              */\n/* coding: utf-8         */\n/* indent-tabs-mode: nil */\n/* tab-width: 2          */\n/* End:                  */\n/* vim: set ft=javascript fenc=utf-8 et ts=2 sts=2 sw=2: */\n/* :mode=javascript:noTabs=true:tabSize=2:indentSize=2:deepIndent=true: */\n\n"
  },
  {
    "path": "lib/parse-js.js",
    "content": "/***********************************************************************\n\n  A JavaScript tokenizer / parser / beautifier / compressor.\n\n  This version is suitable for Node.js.  With minimal changes (the\n  exports stuff) it should work on any JS platform.\n\n  This file contains the tokenizer/parser.  It is a port to JavaScript\n  of parse-js [1], a JavaScript parser library written in Common Lisp\n  by Marijn Haverbeke.  Thank you Marijn!\n\n  [1] http://marijn.haverbeke.nl/parse-js/\n\n  Exported functions:\n\n    - tokenizer(code) -- returns a function.  Call the returned\n      function to fetch the next token.\n\n    - parse(code) -- returns an AST of the given JavaScript code.\n\n  -------------------------------- (C) ---------------------------------\n\n                           Author: Mihai Bazon\n                         <mihai.bazon@gmail.com>\n                       http://mihai.bazon.net/blog\n\n  Distributed under the BSD license:\n\n    Copyright 2010 (c) Mihai Bazon <mihai.bazon@gmail.com>\n    Based on parse-js (http://marijn.haverbeke.nl/parse-js/).\n\n    Redistribution and use in source and binary forms, with or without\n    modification, are permitted provided that the following conditions\n    are met:\n\n        * Redistributions of source code must retain the above\n          copyright notice, this list of conditions and the following\n          disclaimer.\n\n        * Redistributions in binary form must reproduce the above\n          copyright notice, this list of conditions and the following\n          disclaimer in the documentation and/or other materials\n          provided with the distribution.\n\n    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n    TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n    THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n    SUCH DAMAGE.\n\n ***********************************************************************/\n\n/* -----[ Tokenizer (constants) ]----- */\n\nvar KEYWORDS = array_to_hash([\n    \"break\",\n    \"case\",\n    \"catch\",\n    \"const\",\n    \"continue\",\n    \"debugger\",\n    \"default\",\n    \"delete\",\n    \"do\",\n    \"else\",\n    \"finally\",\n    \"for\",\n    \"function\",\n    \"if\",\n    \"in\",\n    \"instanceof\",\n    \"new\",\n    \"return\",\n    \"switch\",\n    \"throw\",\n    \"try\",\n    \"typeof\",\n    \"var\",\n    \"void\",\n    \"while\",\n    \"with\"\n]);\n\nvar RESERVED_WORDS = array_to_hash([\n    \"abstract\",\n    \"boolean\",\n    \"byte\",\n    \"char\",\n    \"class\",\n    \"double\",\n    \"enum\",\n    \"export\",\n    \"extends\",\n    \"final\",\n    \"float\",\n    \"goto\",\n    \"implements\",\n    \"import\",\n    \"int\",\n    \"interface\",\n    \"long\",\n    \"native\",\n    \"package\",\n    \"private\",\n    \"protected\",\n    \"public\",\n    \"short\",\n    \"static\",\n    \"super\",\n    \"synchronized\",\n    \"throws\",\n    \"transient\",\n    \"volatile\"\n]);\n\nvar KEYWORDS_BEFORE_EXPRESSION = array_to_hash([\n    \"return\",\n    \"new\",\n    \"delete\",\n    \"throw\",\n    \"else\",\n    \"case\"\n]);\n\nvar KEYWORDS_ATOM = array_to_hash([\n    \"false\",\n    \"null\",\n    \"true\",\n    \"undefined\"\n]);\n\nvar OPERATOR_CHARS = array_to_hash(characters(\"+-*&%=<>!?|~^\"));\n\nvar RE_HEX_NUMBER = /^0x[0-9a-f]+$/i;\nvar RE_OCT_NUMBER = /^0[0-7]+$/;\nvar RE_DEC_NUMBER = /^\\d*\\.?\\d*(?:e[+-]?\\d*(?:\\d\\.?|\\.?\\d)\\d*)?$/i;\n\nvar OPERATORS = array_to_hash([\n    \"in\",\n    \"instanceof\",\n    \"typeof\",\n    \"new\",\n    \"void\",\n    \"delete\",\n    \"++\",\n    \"--\",\n    \"+\",\n    \"-\",\n    \"!\",\n    \"~\",\n    \"&\",\n    \"|\",\n    \"^\",\n    \"*\",\n    \"/\",\n    \"%\",\n    \">>\",\n    \"<<\",\n    \">>>\",\n    \"<\",\n    \">\",\n    \"<=\",\n    \">=\",\n    \"==\",\n    \"===\",\n    \"!=\",\n    \"!==\",\n    \"?\",\n    \"=\",\n    \"+=\",\n    \"-=\",\n    \"/=\",\n    \"*=\",\n    \"%=\",\n    \">>=\",\n    \"<<=\",\n    \">>>=\",\n    \"|=\",\n    \"^=\",\n    \"&=\",\n    \"&&\",\n    \"||\"\n]);\n\nvar WHITESPACE_CHARS = array_to_hash(characters(\" \\u00a0\\n\\r\\t\\f\\u000b\\u200b\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\uFEFF\"));\n\nvar PUNC_BEFORE_EXPRESSION = array_to_hash(characters(\"[{(,.;:\"));\n\nvar PUNC_CHARS = array_to_hash(characters(\"[]{}(),;:\"));\n\nvar REGEXP_MODIFIERS = array_to_hash(characters(\"gmsiy\"));\n\n/* -----[ Tokenizer ]----- */\n\nvar UNICODE = {  // Unicode 6.1\n    letter: new RegExp(\"[\\\\u0041-\\\\u005A\\\\u0061-\\\\u007A\\\\u00AA\\\\u00B5\\\\u00BA\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u048A-\\\\u0527\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0620-\\\\u064A\\\\u066E\\\\u066F\\\\u0671-\\\\u06D3\\\\u06D5\\\\u06E5\\\\u06E6\\\\u06EE\\\\u06EF\\\\u06FA-\\\\u06FC\\\\u06FF\\\\u0710\\\\u0712-\\\\u072F\\\\u074D-\\\\u07A5\\\\u07B1\\\\u07CA-\\\\u07EA\\\\u07F4\\\\u07F5\\\\u07FA\\\\u0800-\\\\u0815\\\\u081A\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u08A0\\\\u08A2-\\\\u08AC\\\\u0904-\\\\u0939\\\\u093D\\\\u0950\\\\u0958-\\\\u0961\\\\u0971-\\\\u0977\\\\u0979-\\\\u097F\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BD\\\\u09CE\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E1\\\\u09F0\\\\u09F1\\\\u0A05-\\\\u0A0A\\\\u0A0F\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32\\\\u0A33\\\\u0A35\\\\u0A36\\\\u0A38\\\\u0A39\\\\u0A59-\\\\u0A5C\\\\u0A5E\\\\u0A72-\\\\u0A74\\\\u0A85-\\\\u0A8D\\\\u0A8F-\\\\u0A91\\\\u0A93-\\\\u0AA8\\\\u0AAA-\\\\u0AB0\\\\u0AB2\\\\u0AB3\\\\u0AB5-\\\\u0AB9\\\\u0ABD\\\\u0AD0\\\\u0AE0\\\\u0AE1\\\\u0B05-\\\\u0B0C\\\\u0B0F\\\\u0B10\\\\u0B13-\\\\u0B28\\\\u0B2A-\\\\u0B30\\\\u0B32\\\\u0B33\\\\u0B35-\\\\u0B39\\\\u0B3D\\\\u0B5C\\\\u0B5D\\\\u0B5F-\\\\u0B61\\\\u0B71\\\\u0B83\\\\u0B85-\\\\u0B8A\\\\u0B8E-\\\\u0B90\\\\u0B92-\\\\u0B95\\\\u0B99\\\\u0B9A\\\\u0B9C\\\\u0B9E\\\\u0B9F\\\\u0BA3\\\\u0BA4\\\\u0BA8-\\\\u0BAA\\\\u0BAE-\\\\u0BB9\\\\u0BD0\\\\u0C05-\\\\u0C0C\\\\u0C0E-\\\\u0C10\\\\u0C12-\\\\u0C28\\\\u0C2A-\\\\u0C33\\\\u0C35-\\\\u0C39\\\\u0C3D\\\\u0C58\\\\u0C59\\\\u0C60\\\\u0C61\\\\u0C85-\\\\u0C8C\\\\u0C8E-\\\\u0C90\\\\u0C92-\\\\u0CA8\\\\u0CAA-\\\\u0CB3\\\\u0CB5-\\\\u0CB9\\\\u0CBD\\\\u0CDE\\\\u0CE0\\\\u0CE1\\\\u0CF1\\\\u0CF2\\\\u0D05-\\\\u0D0C\\\\u0D0E-\\\\u0D10\\\\u0D12-\\\\u0D3A\\\\u0D3D\\\\u0D4E\\\\u0D60\\\\u0D61\\\\u0D7A-\\\\u0D7F\\\\u0D85-\\\\u0D96\\\\u0D9A-\\\\u0DB1\\\\u0DB3-\\\\u0DBB\\\\u0DBD\\\\u0DC0-\\\\u0DC6\\\\u0E01-\\\\u0E30\\\\u0E32\\\\u0E33\\\\u0E40-\\\\u0E46\\\\u0E81\\\\u0E82\\\\u0E84\\\\u0E87\\\\u0E88\\\\u0E8A\\\\u0E8D\\\\u0E94-\\\\u0E97\\\\u0E99-\\\\u0E9F\\\\u0EA1-\\\\u0EA3\\\\u0EA5\\\\u0EA7\\\\u0EAA\\\\u0EAB\\\\u0EAD-\\\\u0EB0\\\\u0EB2\\\\u0EB3\\\\u0EBD\\\\u0EC0-\\\\u0EC4\\\\u0EC6\\\\u0EDC-\\\\u0EDF\\\\u0F00\\\\u0F40-\\\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F88-\\\\u0F8C\\\\u1000-\\\\u102A\\\\u103F\\\\u1050-\\\\u1055\\\\u105A-\\\\u105D\\\\u1061\\\\u1065\\\\u1066\\\\u106E-\\\\u1070\\\\u1075-\\\\u1081\\\\u108E\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F0\\\\u1700-\\\\u170C\\\\u170E-\\\\u1711\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1780-\\\\u17B3\\\\u17D7\\\\u17DC\\\\u1820-\\\\u1877\\\\u1880-\\\\u18A8\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191C\\\\u1950-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19C1-\\\\u19C7\\\\u1A00-\\\\u1A16\\\\u1A20-\\\\u1A54\\\\u1AA7\\\\u1B05-\\\\u1B33\\\\u1B45-\\\\u1B4B\\\\u1B83-\\\\u1BA0\\\\u1BAE\\\\u1BAF\\\\u1BBA-\\\\u1BE5\\\\u1C00-\\\\u1C23\\\\u1C4D-\\\\u1C4F\\\\u1C5A-\\\\u1C7D\\\\u1CE9-\\\\u1CEC\\\\u1CEE-\\\\u1CF1\\\\u1CF5\\\\u1CF6\\\\u1D00-\\\\u1DBF\\\\u1E00-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CEE\\\\u2CF2\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D80-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA61F\\\\uA62A\\\\uA62B\\\\uA640-\\\\uA66E\\\\uA67F-\\\\uA697\\\\uA6A0-\\\\uA6EF\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA793\\\\uA7A0-\\\\uA7AA\\\\uA7F8-\\\\uA801\\\\uA803-\\\\uA805\\\\uA807-\\\\uA80A\\\\uA80C-\\\\uA822\\\\uA840-\\\\uA873\\\\uA882-\\\\uA8B3\\\\uA8F2-\\\\uA8F7\\\\uA8FB\\\\uA90A-\\\\uA925\\\\uA930-\\\\uA946\\\\uA960-\\\\uA97C\\\\uA984-\\\\uA9B2\\\\uA9CF\\\\uAA00-\\\\uAA28\\\\uAA40-\\\\uAA42\\\\uAA44-\\\\uAA4B\\\\uAA60-\\\\uAA76\\\\uAA7A\\\\uAA80-\\\\uAAAF\\\\uAAB1\\\\uAAB5\\\\uAAB6\\\\uAAB9-\\\\uAABD\\\\uAAC0\\\\uAAC2\\\\uAADB-\\\\uAADD\\\\uAAE0-\\\\uAAEA\\\\uAAF2-\\\\uAAF4\\\\uAB01-\\\\uAB06\\\\uAB09-\\\\uAB0E\\\\uAB11-\\\\uAB16\\\\uAB20-\\\\uAB26\\\\uAB28-\\\\uAB2E\\\\uABC0-\\\\uABE2\\\\uAC00-\\\\uD7A3\\\\uD7B0-\\\\uD7C6\\\\uD7CB-\\\\uD7FB\\\\uF900-\\\\uFA6D\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D\\\\uFB1F-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF21-\\\\uFF3A\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]\"),\n    combining_mark: new RegExp(\"[\\\\u0300-\\\\u036F\\\\u0483-\\\\u0487\\\\u0591-\\\\u05BD\\\\u05BF\\\\u05C1\\\\u05C2\\\\u05C4\\\\u05C5\\\\u05C7\\\\u0610-\\\\u061A\\\\u064B-\\\\u065F\\\\u0670\\\\u06D6-\\\\u06DC\\\\u06DF-\\\\u06E4\\\\u06E7\\\\u06E8\\\\u06EA-\\\\u06ED\\\\u0711\\\\u0730-\\\\u074A\\\\u07A6-\\\\u07B0\\\\u07EB-\\\\u07F3\\\\u0816-\\\\u0819\\\\u081B-\\\\u0823\\\\u0825-\\\\u0827\\\\u0829-\\\\u082D\\\\u0859-\\\\u085B\\\\u08E4-\\\\u08FE\\\\u0900-\\\\u0903\\\\u093A-\\\\u093C\\\\u093E-\\\\u094F\\\\u0951-\\\\u0957\\\\u0962\\\\u0963\\\\u0981-\\\\u0983\\\\u09BC\\\\u09BE-\\\\u09C4\\\\u09C7\\\\u09C8\\\\u09CB-\\\\u09CD\\\\u09D7\\\\u09E2\\\\u09E3\\\\u0A01-\\\\u0A03\\\\u0A3C\\\\u0A3E-\\\\u0A42\\\\u0A47\\\\u0A48\\\\u0A4B-\\\\u0A4D\\\\u0A51\\\\u0A70\\\\u0A71\\\\u0A75\\\\u0A81-\\\\u0A83\\\\u0ABC\\\\u0ABE-\\\\u0AC5\\\\u0AC7-\\\\u0AC9\\\\u0ACB-\\\\u0ACD\\\\u0AE2\\\\u0AE3\\\\u0B01-\\\\u0B03\\\\u0B3C\\\\u0B3E-\\\\u0B44\\\\u0B47\\\\u0B48\\\\u0B4B-\\\\u0B4D\\\\u0B56\\\\u0B57\\\\u0B62\\\\u0B63\\\\u0B82\\\\u0BBE-\\\\u0BC2\\\\u0BC6-\\\\u0BC8\\\\u0BCA-\\\\u0BCD\\\\u0BD7\\\\u0C01-\\\\u0C03\\\\u0C3E-\\\\u0C44\\\\u0C46-\\\\u0C48\\\\u0C4A-\\\\u0C4D\\\\u0C55\\\\u0C56\\\\u0C62\\\\u0C63\\\\u0C82\\\\u0C83\\\\u0CBC\\\\u0CBE-\\\\u0CC4\\\\u0CC6-\\\\u0CC8\\\\u0CCA-\\\\u0CCD\\\\u0CD5\\\\u0CD6\\\\u0CE2\\\\u0CE3\\\\u0D02\\\\u0D03\\\\u0D3E-\\\\u0D44\\\\u0D46-\\\\u0D48\\\\u0D4A-\\\\u0D4D\\\\u0D57\\\\u0D62\\\\u0D63\\\\u0D82\\\\u0D83\\\\u0DCA\\\\u0DCF-\\\\u0DD4\\\\u0DD6\\\\u0DD8-\\\\u0DDF\\\\u0DF2\\\\u0DF3\\\\u0E31\\\\u0E34-\\\\u0E3A\\\\u0E47-\\\\u0E4E\\\\u0EB1\\\\u0EB4-\\\\u0EB9\\\\u0EBB\\\\u0EBC\\\\u0EC8-\\\\u0ECD\\\\u0F18\\\\u0F19\\\\u0F35\\\\u0F37\\\\u0F39\\\\u0F3E\\\\u0F3F\\\\u0F71-\\\\u0F84\\\\u0F86\\\\u0F87\\\\u0F8D-\\\\u0F97\\\\u0F99-\\\\u0FBC\\\\u0FC6\\\\u102B-\\\\u103E\\\\u1056-\\\\u1059\\\\u105E-\\\\u1060\\\\u1062-\\\\u1064\\\\u1067-\\\\u106D\\\\u1071-\\\\u1074\\\\u1082-\\\\u108D\\\\u108F\\\\u109A-\\\\u109D\\\\u135D-\\\\u135F\\\\u1712-\\\\u1714\\\\u1732-\\\\u1734\\\\u1752\\\\u1753\\\\u1772\\\\u1773\\\\u17B4-\\\\u17D3\\\\u17DD\\\\u180B-\\\\u180D\\\\u18A9\\\\u1920-\\\\u192B\\\\u1930-\\\\u193B\\\\u19B0-\\\\u19C0\\\\u19C8\\\\u19C9\\\\u1A17-\\\\u1A1B\\\\u1A55-\\\\u1A5E\\\\u1A60-\\\\u1A7C\\\\u1A7F\\\\u1B00-\\\\u1B04\\\\u1B34-\\\\u1B44\\\\u1B6B-\\\\u1B73\\\\u1B80-\\\\u1B82\\\\u1BA1-\\\\u1BAD\\\\u1BE6-\\\\u1BF3\\\\u1C24-\\\\u1C37\\\\u1CD0-\\\\u1CD2\\\\u1CD4-\\\\u1CE8\\\\u1CED\\\\u1CF2-\\\\u1CF4\\\\u1DC0-\\\\u1DE6\\\\u1DFC-\\\\u1DFF\\\\u20D0-\\\\u20DC\\\\u20E1\\\\u20E5-\\\\u20F0\\\\u2CEF-\\\\u2CF1\\\\u2D7F\\\\u2DE0-\\\\u2DFF\\\\u302A-\\\\u302F\\\\u3099\\\\u309A\\\\uA66F\\\\uA674-\\\\uA67D\\\\uA69F\\\\uA6F0\\\\uA6F1\\\\uA802\\\\uA806\\\\uA80B\\\\uA823-\\\\uA827\\\\uA880\\\\uA881\\\\uA8B4-\\\\uA8C4\\\\uA8E0-\\\\uA8F1\\\\uA926-\\\\uA92D\\\\uA947-\\\\uA953\\\\uA980-\\\\uA983\\\\uA9B3-\\\\uA9C0\\\\uAA29-\\\\uAA36\\\\uAA43\\\\uAA4C\\\\uAA4D\\\\uAA7B\\\\uAAB0\\\\uAAB2-\\\\uAAB4\\\\uAAB7\\\\uAAB8\\\\uAABE\\\\uAABF\\\\uAAC1\\\\uAAEB-\\\\uAAEF\\\\uAAF5\\\\uAAF6\\\\uABE3-\\\\uABEA\\\\uABEC\\\\uABED\\\\uFB1E\\\\uFE00-\\\\uFE0F\\\\uFE20-\\\\uFE26]\"),\n    connector_punctuation: new RegExp(\"[\\\\u005F\\\\u203F\\\\u2040\\\\u2054\\\\uFE33\\\\uFE34\\\\uFE4D-\\\\uFE4F\\\\uFF3F]\"),\n    digit: new RegExp(\"[\\\\u0030-\\\\u0039\\\\u0660-\\\\u0669\\\\u06F0-\\\\u06F9\\\\u07C0-\\\\u07C9\\\\u0966-\\\\u096F\\\\u09E6-\\\\u09EF\\\\u0A66-\\\\u0A6F\\\\u0AE6-\\\\u0AEF\\\\u0B66-\\\\u0B6F\\\\u0BE6-\\\\u0BEF\\\\u0C66-\\\\u0C6F\\\\u0CE6-\\\\u0CEF\\\\u0D66-\\\\u0D6F\\\\u0E50-\\\\u0E59\\\\u0ED0-\\\\u0ED9\\\\u0F20-\\\\u0F29\\\\u1040-\\\\u1049\\\\u1090-\\\\u1099\\\\u17E0-\\\\u17E9\\\\u1810-\\\\u1819\\\\u1946-\\\\u194F\\\\u19D0-\\\\u19D9\\\\u1A80-\\\\u1A89\\\\u1A90-\\\\u1A99\\\\u1B50-\\\\u1B59\\\\u1BB0-\\\\u1BB9\\\\u1C40-\\\\u1C49\\\\u1C50-\\\\u1C59\\\\uA620-\\\\uA629\\\\uA8D0-\\\\uA8D9\\\\uA900-\\\\uA909\\\\uA9D0-\\\\uA9D9\\\\uAA50-\\\\uAA59\\\\uABF0-\\\\uABF9\\\\uFF10-\\\\uFF19]\")\n};\n\nfunction is_letter(ch) {\n    return UNICODE.letter.test(ch);\n};\n\nfunction is_digit(ch) {\n    ch = ch.charCodeAt(0);\n    return ch >= 48 && ch <= 57;\n};\n\nfunction is_unicode_digit(ch) {\n    return UNICODE.digit.test(ch);\n}\n\nfunction is_alphanumeric_char(ch) {\n    return is_digit(ch) || is_letter(ch);\n};\n\nfunction is_unicode_combining_mark(ch) {\n    return UNICODE.combining_mark.test(ch);\n};\n\nfunction is_unicode_connector_punctuation(ch) {\n    return UNICODE.connector_punctuation.test(ch);\n};\n\nfunction is_identifier_start(ch) {\n    return ch == \"$\" || ch == \"_\" || is_letter(ch);\n};\n\nfunction is_identifier_char(ch) {\n    return is_identifier_start(ch)\n        || is_unicode_combining_mark(ch)\n        || is_unicode_digit(ch)\n        || is_unicode_connector_punctuation(ch)\n        || ch == \"\\u200c\" // zero-width non-joiner <ZWNJ>\n        || ch == \"\\u200d\" // zero-width joiner <ZWJ> (in my ECMA-262 PDF, this is also 200c)\n    ;\n};\n\nfunction parse_js_number(num) {\n    if (RE_HEX_NUMBER.test(num)) {\n        return parseInt(num.substr(2), 16);\n    } else if (RE_OCT_NUMBER.test(num)) {\n        return parseInt(num.substr(1), 8);\n    } else if (RE_DEC_NUMBER.test(num)) {\n        return parseFloat(num);\n    }\n};\n\nfunction JS_Parse_Error(message, line, col, pos) {\n    this.message = message;\n    this.line = line + 1;\n    this.col = col + 1;\n    this.pos = pos + 1;\n    this.stack = new Error().stack;\n};\n\nJS_Parse_Error.prototype.toString = function() {\n    return this.message + \" (line: \" + this.line + \", col: \" + this.col + \", pos: \" + this.pos + \")\" + \"\\n\\n\" + this.stack;\n};\n\nfunction js_error(message, line, col, pos) {\n    throw new JS_Parse_Error(message, line, col, pos);\n};\n\nfunction is_token(token, type, val) {\n    return token.type == type && (val == null || token.value == val);\n};\n\nvar EX_EOF = {};\n\nfunction tokenizer($TEXT) {\n\n    var S = {\n        text            : $TEXT.replace(/\\r\\n?|[\\n\\u2028\\u2029]/g, \"\\n\").replace(/^\\uFEFF/, ''),\n        pos             : 0,\n        tokpos          : 0,\n        line            : 0,\n        tokline         : 0,\n        col             : 0,\n        tokcol          : 0,\n        newline_before  : false,\n        regex_allowed   : false,\n        comments_before : []\n    };\n\n    function peek() { return S.text.charAt(S.pos); };\n\n    function next(signal_eof, in_string) {\n        var ch = S.text.charAt(S.pos++);\n        if (signal_eof && !ch)\n            throw EX_EOF;\n        if (ch == \"\\n\") {\n            S.newline_before = S.newline_before || !in_string;\n            ++S.line;\n            S.col = 0;\n        } else {\n            ++S.col;\n        }\n        return ch;\n    };\n\n    function eof() {\n        return !S.peek();\n    };\n\n    function find(what, signal_eof) {\n        var pos = S.text.indexOf(what, S.pos);\n        if (signal_eof && pos == -1) throw EX_EOF;\n        return pos;\n    };\n\n    function start_token() {\n        S.tokline = S.line;\n        S.tokcol = S.col;\n        S.tokpos = S.pos;\n    };\n\n    function token(type, value, is_comment) {\n        S.regex_allowed = ((type == \"operator\" && !HOP(UNARY_POSTFIX, value)) ||\n                           (type == \"keyword\" && HOP(KEYWORDS_BEFORE_EXPRESSION, value)) ||\n                           (type == \"punc\" && HOP(PUNC_BEFORE_EXPRESSION, value)));\n        var ret = {\n            type   : type,\n            value  : value,\n            line   : S.tokline,\n            col    : S.tokcol,\n            pos    : S.tokpos,\n            endpos : S.pos,\n            nlb    : S.newline_before\n        };\n        if (!is_comment) {\n            ret.comments_before = S.comments_before;\n            S.comments_before = [];\n            // make note of any newlines in the comments that came before\n            for (var i = 0, len = ret.comments_before.length; i < len; i++) {\n                ret.nlb = ret.nlb || ret.comments_before[i].nlb;\n            }\n        }\n        S.newline_before = false;\n        return ret;\n    };\n\n    function skip_whitespace() {\n        while (HOP(WHITESPACE_CHARS, peek()))\n            next();\n    };\n\n    function read_while(pred) {\n        var ret = \"\", ch = peek(), i = 0;\n        while (ch && pred(ch, i++)) {\n            ret += next();\n            ch = peek();\n        }\n        return ret;\n    };\n\n    function parse_error(err) {\n        js_error(err, S.tokline, S.tokcol, S.tokpos);\n    };\n\n    function read_num(prefix) {\n        var has_e = false, after_e = false, has_x = false, has_dot = prefix == \".\";\n        var num = read_while(function(ch, i){\n            if (ch == \"x\" || ch == \"X\") {\n                if (has_x) return false;\n                return has_x = true;\n            }\n            if (!has_x && (ch == \"E\" || ch == \"e\")) {\n                if (has_e) return false;\n                return has_e = after_e = true;\n            }\n            if (ch == \"-\") {\n                if (after_e || (i == 0 && !prefix)) return true;\n                return false;\n            }\n            if (ch == \"+\") return after_e;\n            after_e = false;\n            if (ch == \".\") {\n                if (!has_dot && !has_x && !has_e)\n                    return has_dot = true;\n                return false;\n            }\n            return is_alphanumeric_char(ch);\n        });\n        if (prefix)\n            num = prefix + num;\n        var valid = parse_js_number(num);\n        if (!isNaN(valid)) {\n            return token(\"num\", valid);\n        } else {\n            parse_error(\"Invalid syntax: \" + num);\n        }\n    };\n\n    function read_escaped_char(in_string) {\n        var ch = next(true, in_string);\n        switch (ch) {\n          case \"n\" : return \"\\n\";\n          case \"r\" : return \"\\r\";\n          case \"t\" : return \"\\t\";\n          case \"b\" : return \"\\b\";\n          case \"v\" : return \"\\u000b\";\n          case \"f\" : return \"\\f\";\n          case \"0\" : return \"\\0\";\n          case \"x\" : return String.fromCharCode(hex_bytes(2));\n          case \"u\" : return String.fromCharCode(hex_bytes(4));\n          case \"\\n\": return \"\";\n          default  : return ch;\n        }\n    };\n\n    function hex_bytes(n) {\n        var num = 0;\n        for (; n > 0; --n) {\n            var digit = parseInt(next(true), 16);\n            if (isNaN(digit))\n                parse_error(\"Invalid hex-character pattern in string\");\n            num = (num << 4) | digit;\n        }\n        return num;\n    };\n\n    function read_string() {\n        return with_eof_error(\"Unterminated string constant\", function(){\n            var quote = next(), ret = \"\";\n            for (;;) {\n                var ch = next(true);\n                if (ch == \"\\\\\") {\n                    // read OctalEscapeSequence (XXX: deprecated if \"strict mode\")\n                    // https://github.com/mishoo/UglifyJS/issues/178\n                    var octal_len = 0, first = null;\n                    ch = read_while(function(ch){\n                        if (ch >= \"0\" && ch <= \"7\") {\n                            if (!first) {\n                                first = ch;\n                                return ++octal_len;\n                            }\n                            else if (first <= \"3\" && octal_len <= 2) return ++octal_len;\n                            else if (first >= \"4\" && octal_len <= 1) return ++octal_len;\n                        }\n                        return false;\n                    });\n                    if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8));\n                    else ch = read_escaped_char(true);\n                }\n                else if (ch == quote) break;\n                else if (ch == \"\\n\") throw EX_EOF;\n                ret += ch;\n            }\n            return token(\"string\", ret);\n        });\n    };\n\n    function read_line_comment() {\n        next();\n        var i = find(\"\\n\"), ret;\n        if (i == -1) {\n            ret = S.text.substr(S.pos);\n            S.pos = S.text.length;\n        } else {\n            ret = S.text.substring(S.pos, i);\n            S.pos = i;\n        }\n        return token(\"comment1\", ret, true);\n    };\n\n    function read_multiline_comment() {\n        next();\n        return with_eof_error(\"Unterminated multiline comment\", function(){\n            var i = find(\"*/\", true),\n            text = S.text.substring(S.pos, i);\n            S.pos = i + 2;\n            S.line += text.split(\"\\n\").length - 1;\n            S.newline_before = S.newline_before || text.indexOf(\"\\n\") >= 0;\n\n            // https://github.com/mishoo/UglifyJS/issues/#issue/100\n            if (/^@cc_on/i.test(text)) {\n                warn(\"WARNING: at line \" + S.line);\n                warn(\"*** Found \\\"conditional comment\\\": \" + text);\n                warn(\"*** UglifyJS DISCARDS ALL COMMENTS.  This means your code might no longer work properly in Internet Explorer.\");\n            }\n\n            return token(\"comment2\", text, true);\n        });\n    };\n\n    function read_name() {\n        var backslash = false, name = \"\", ch, escaped = false, hex;\n        while ((ch = peek()) != null) {\n            if (!backslash) {\n                if (ch == \"\\\\\") escaped = backslash = true, next();\n                else if (is_identifier_char(ch)) name += next();\n                else break;\n            }\n            else {\n                if (ch != \"u\") parse_error(\"Expecting UnicodeEscapeSequence -- uXXXX\");\n                ch = read_escaped_char();\n                if (!is_identifier_char(ch)) parse_error(\"Unicode char: \" + ch.charCodeAt(0) + \" is not valid in identifier\");\n                name += ch;\n                backslash = false;\n            }\n        }\n        if (HOP(KEYWORDS, name) && escaped) {\n            hex = name.charCodeAt(0).toString(16).toUpperCase();\n            name = \"\\\\u\" + \"0000\".substr(hex.length) + hex + name.slice(1);\n        }\n        return name;\n    };\n\n    function read_regexp(regexp) {\n        return with_eof_error(\"Unterminated regular expression\", function(){\n            var prev_backslash = false, ch, in_class = false;\n            while ((ch = next(true))) if (prev_backslash) {\n                regexp += \"\\\\\" + ch;\n                prev_backslash = false;\n            } else if (ch == \"[\") {\n                in_class = true;\n                regexp += ch;\n            } else if (ch == \"]\" && in_class) {\n                in_class = false;\n                regexp += ch;\n            } else if (ch == \"/\" && !in_class) {\n                break;\n            } else if (ch == \"\\\\\") {\n                prev_backslash = true;\n            } else {\n                regexp += ch;\n            }\n            var mods = read_name();\n            return token(\"regexp\", [ regexp, mods ]);\n        });\n    };\n\n    function read_operator(prefix) {\n        function grow(op) {\n            if (!peek()) return op;\n            var bigger = op + peek();\n            if (HOP(OPERATORS, bigger)) {\n                next();\n                return grow(bigger);\n            } else {\n                return op;\n            }\n        };\n        return token(\"operator\", grow(prefix || next()));\n    };\n\n    function handle_slash() {\n        next();\n        var regex_allowed = S.regex_allowed;\n        switch (peek()) {\n          case \"/\":\n            S.comments_before.push(read_line_comment());\n            S.regex_allowed = regex_allowed;\n            return next_token();\n          case \"*\":\n            S.comments_before.push(read_multiline_comment());\n            S.regex_allowed = regex_allowed;\n            return next_token();\n        }\n        return S.regex_allowed ? read_regexp(\"\") : read_operator(\"/\");\n    };\n\n    function handle_dot() {\n        next();\n        return is_digit(peek())\n            ? read_num(\".\")\n            : token(\"punc\", \".\");\n    };\n\n    function read_word() {\n        var word = read_name();\n        return !HOP(KEYWORDS, word)\n            ? token(\"name\", word)\n            : HOP(OPERATORS, word)\n            ? token(\"operator\", word)\n            : HOP(KEYWORDS_ATOM, word)\n            ? token(\"atom\", word)\n            : token(\"keyword\", word);\n    };\n\n    function with_eof_error(eof_error, cont) {\n        try {\n            return cont();\n        } catch(ex) {\n            if (ex === EX_EOF) parse_error(eof_error);\n            else throw ex;\n        }\n    };\n\n    function next_token(force_regexp) {\n        if (force_regexp != null)\n            return read_regexp(force_regexp);\n        skip_whitespace();\n        start_token();\n        var ch = peek();\n        if (!ch) return token(\"eof\");\n        if (is_digit(ch)) return read_num();\n        if (ch == '\"' || ch == \"'\") return read_string();\n        if (HOP(PUNC_CHARS, ch)) return token(\"punc\", next());\n        if (ch == \".\") return handle_dot();\n        if (ch == \"/\") return handle_slash();\n        if (HOP(OPERATOR_CHARS, ch)) return read_operator();\n        if (ch == \"\\\\\" || is_identifier_start(ch)) return read_word();\n        parse_error(\"Unexpected character '\" + ch + \"'\");\n    };\n\n    next_token.context = function(nc) {\n        if (nc) S = nc;\n        return S;\n    };\n\n    return next_token;\n\n};\n\n/* -----[ Parser (constants) ]----- */\n\nvar UNARY_PREFIX = array_to_hash([\n    \"typeof\",\n    \"void\",\n    \"delete\",\n    \"--\",\n    \"++\",\n    \"!\",\n    \"~\",\n    \"-\",\n    \"+\"\n]);\n\nvar UNARY_POSTFIX = array_to_hash([ \"--\", \"++\" ]);\n\nvar ASSIGNMENT = (function(a, ret, i){\n    while (i < a.length) {\n        ret[a[i]] = a[i].substr(0, a[i].length - 1);\n        i++;\n    }\n    return ret;\n})(\n    [\"+=\", \"-=\", \"/=\", \"*=\", \"%=\", \">>=\", \"<<=\", \">>>=\", \"|=\", \"^=\", \"&=\"],\n    { \"=\": true },\n    0\n);\n\nvar PRECEDENCE = (function(a, ret){\n    for (var i = 0, n = 1; i < a.length; ++i, ++n) {\n        var b = a[i];\n        for (var j = 0; j < b.length; ++j) {\n            ret[b[j]] = n;\n        }\n    }\n    return ret;\n})(\n    [\n        [\"||\"],\n        [\"&&\"],\n        [\"|\"],\n        [\"^\"],\n        [\"&\"],\n        [\"==\", \"===\", \"!=\", \"!==\"],\n        [\"<\", \">\", \"<=\", \">=\", \"in\", \"instanceof\"],\n        [\">>\", \"<<\", \">>>\"],\n        [\"+\", \"-\"],\n        [\"*\", \"/\", \"%\"]\n    ],\n    {}\n);\n\nvar STATEMENTS_WITH_LABELS = array_to_hash([ \"for\", \"do\", \"while\", \"switch\" ]);\n\nvar ATOMIC_START_TOKEN = array_to_hash([ \"atom\", \"num\", \"string\", \"regexp\", \"name\" ]);\n\n/* -----[ Parser ]----- */\n\nfunction NodeWithToken(str, start, end) {\n    this.name = str;\n    this.start = start;\n    this.end = end;\n};\n\nNodeWithToken.prototype.toString = function() { return this.name; };\n\nfunction parse($TEXT, exigent_mode, embed_tokens) {\n\n    var S = {\n        input         : typeof $TEXT == \"string\" ? tokenizer($TEXT, true) : $TEXT,\n        token         : null,\n        prev          : null,\n        peeked        : null,\n        in_function   : 0,\n        in_directives : true,\n        in_loop       : 0,\n        labels        : []\n    };\n\n    S.token = next();\n\n    function is(type, value) {\n        return is_token(S.token, type, value);\n    };\n\n    function peek() { return S.peeked || (S.peeked = S.input()); };\n\n    function next() {\n        S.prev = S.token;\n        if (S.peeked) {\n            S.token = S.peeked;\n            S.peeked = null;\n        } else {\n            S.token = S.input();\n        }\n        S.in_directives = S.in_directives && (\n            S.token.type == \"string\" || is(\"punc\", \";\")\n        );\n        return S.token;\n    };\n\n    function prev() {\n        return S.prev;\n    };\n\n    function croak(msg, line, col, pos) {\n        var ctx = S.input.context();\n        js_error(msg,\n                 line != null ? line : ctx.tokline,\n                 col != null ? col : ctx.tokcol,\n                 pos != null ? pos : ctx.tokpos);\n    };\n\n    function token_error(token, msg) {\n        croak(msg, token.line, token.col);\n    };\n\n    function unexpected(token) {\n        if (token == null)\n            token = S.token;\n        token_error(token, \"Unexpected token: \" + token.type + \" (\" + token.value + \")\");\n    };\n\n    function expect_token(type, val) {\n        if (is(type, val)) {\n            return next();\n        }\n        token_error(S.token, \"Unexpected token \" + S.token.type + \", expected \" + type);\n    };\n\n    function expect(punc) { return expect_token(\"punc\", punc); };\n\n    function can_insert_semicolon() {\n        return !exigent_mode && (\n            S.token.nlb || is(\"eof\") || is(\"punc\", \"}\")\n        );\n    };\n\n    function semicolon() {\n        if (is(\"punc\", \";\")) next();\n        else if (!can_insert_semicolon()) unexpected();\n    };\n\n    function as() {\n        return slice(arguments);\n    };\n\n    function parenthesised() {\n        expect(\"(\");\n        var ex = expression();\n        expect(\")\");\n        return ex;\n    };\n\n    function add_tokens(str, start, end) {\n        return str instanceof NodeWithToken ? str : new NodeWithToken(str, start, end);\n    };\n\n    function maybe_embed_tokens(parser) {\n        if (embed_tokens) return function() {\n            var start = S.token;\n            var ast = parser.apply(this, arguments);\n            ast[0] = add_tokens(ast[0], start, prev());\n            return ast;\n        };\n        else return parser;\n    };\n\n    var statement = maybe_embed_tokens(function() {\n        if (is(\"operator\", \"/\") || is(\"operator\", \"/=\")) {\n            S.peeked = null;\n            S.token = S.input(S.token.value.substr(1)); // force regexp\n        }\n        switch (S.token.type) {\n          case \"string\":\n            var dir = S.in_directives, stat = simple_statement();\n            if (dir && stat[1][0] == \"string\" && !is(\"punc\", \",\"))\n                return as(\"directive\", stat[1][1]);\n            return stat;\n          case \"num\":\n          case \"regexp\":\n          case \"operator\":\n          case \"atom\":\n            return simple_statement();\n\n          case \"name\":\n            return is_token(peek(), \"punc\", \":\")\n                ? labeled_statement(prog1(S.token.value, next, next))\n                : simple_statement();\n\n          case \"punc\":\n            switch (S.token.value) {\n              case \"{\":\n                return as(\"block\", block_());\n              case \"[\":\n              case \"(\":\n                return simple_statement();\n              case \";\":\n                next();\n                return as(\"block\");\n              default:\n                unexpected();\n            }\n\n          case \"keyword\":\n            switch (prog1(S.token.value, next)) {\n              case \"break\":\n                return break_cont(\"break\");\n\n              case \"continue\":\n                return break_cont(\"continue\");\n\n              case \"debugger\":\n                semicolon();\n                return as(\"debugger\");\n\n              case \"do\":\n                return (function(body){\n                    expect_token(\"keyword\", \"while\");\n                    return as(\"do\", prog1(parenthesised, semicolon), body);\n                })(in_loop(statement));\n\n              case \"for\":\n                return for_();\n\n              case \"function\":\n                return function_(true);\n\n              case \"if\":\n                return if_();\n\n              case \"return\":\n                if (S.in_function == 0)\n                    croak(\"'return' outside of function\");\n                return as(\"return\",\n                          is(\"punc\", \";\")\n                          ? (next(), null)\n                          : can_insert_semicolon()\n                          ? null\n                          : prog1(expression, semicolon));\n\n              case \"switch\":\n                return as(\"switch\", parenthesised(), switch_block_());\n\n              case \"throw\":\n                if (S.token.nlb)\n                    croak(\"Illegal newline after 'throw'\");\n                return as(\"throw\", prog1(expression, semicolon));\n\n              case \"try\":\n                return try_();\n\n              case \"var\":\n                return prog1(var_, semicolon);\n\n              case \"const\":\n                return prog1(const_, semicolon);\n\n              case \"while\":\n                return as(\"while\", parenthesised(), in_loop(statement));\n\n              case \"with\":\n                return as(\"with\", parenthesised(), statement());\n\n              default:\n                unexpected();\n            }\n        }\n    });\n\n    function labeled_statement(label) {\n        S.labels.push(label);\n        var start = S.token, stat = statement();\n        if (exigent_mode && !HOP(STATEMENTS_WITH_LABELS, stat[0]))\n            unexpected(start);\n        S.labels.pop();\n        return as(\"label\", label, stat);\n    };\n\n    function simple_statement() {\n        return as(\"stat\", prog1(expression, semicolon));\n    };\n\n    function break_cont(type) {\n        var name;\n        if (!can_insert_semicolon()) {\n            name = is(\"name\") ? S.token.value : null;\n        }\n        if (name != null) {\n            next();\n            if (!member(name, S.labels))\n                croak(\"Label \" + name + \" without matching loop or statement\");\n        }\n        else if (S.in_loop == 0)\n            croak(type + \" not inside a loop or switch\");\n        semicolon();\n        return as(type, name);\n    };\n\n    function for_() {\n        expect(\"(\");\n        var init = null;\n        if (!is(\"punc\", \";\")) {\n            init = is(\"keyword\", \"var\")\n                ? (next(), var_(true))\n                : expression(true, true);\n            if (is(\"operator\", \"in\")) {\n                if (init[0] == \"var\" && init[1].length > 1)\n                    croak(\"Only one variable declaration allowed in for..in loop\");\n                return for_in(init);\n            }\n        }\n        return regular_for(init);\n    };\n\n    function regular_for(init) {\n        expect(\";\");\n        var test = is(\"punc\", \";\") ? null : expression();\n        expect(\";\");\n        var step = is(\"punc\", \")\") ? null : expression();\n        expect(\")\");\n        return as(\"for\", init, test, step, in_loop(statement));\n    };\n\n    function for_in(init) {\n        var lhs = init[0] == \"var\" ? as(\"name\", init[1][0]) : init;\n        next();\n        var obj = expression();\n        expect(\")\");\n        return as(\"for-in\", init, lhs, obj, in_loop(statement));\n    };\n\n    var function_ = function(in_statement) {\n        var name = is(\"name\") ? prog1(S.token.value, next) : null;\n        if (in_statement && !name)\n            unexpected();\n        expect(\"(\");\n        return as(in_statement ? \"defun\" : \"function\",\n                  name,\n                  // arguments\n                  (function(first, a){\n                      while (!is(\"punc\", \")\")) {\n                          if (first) first = false; else expect(\",\");\n                          if (!is(\"name\")) unexpected();\n                          a.push(S.token.value);\n                          next();\n                      }\n                      next();\n                      return a;\n                  })(true, []),\n                  // body\n                  (function(){\n                      ++S.in_function;\n                      var loop = S.in_loop;\n                      S.in_directives = true;\n                      S.in_loop = 0;\n                      var a = block_();\n                      --S.in_function;\n                      S.in_loop = loop;\n                      return a;\n                  })());\n    };\n\n    function if_() {\n        var cond = parenthesised(), body = statement(), belse;\n        if (is(\"keyword\", \"else\")) {\n            next();\n            belse = statement();\n        }\n        return as(\"if\", cond, body, belse);\n    };\n\n    function block_() {\n        expect(\"{\");\n        var a = [];\n        while (!is(\"punc\", \"}\")) {\n            if (is(\"eof\")) unexpected();\n            a.push(statement());\n        }\n        next();\n        return a;\n    };\n\n    var switch_block_ = curry(in_loop, function(){\n        expect(\"{\");\n        var a = [], cur = null;\n        while (!is(\"punc\", \"}\")) {\n            if (is(\"eof\")) unexpected();\n            if (is(\"keyword\", \"case\")) {\n                next();\n                cur = [];\n                a.push([ expression(), cur ]);\n                expect(\":\");\n            }\n            else if (is(\"keyword\", \"default\")) {\n                next();\n                expect(\":\");\n                cur = [];\n                a.push([ null, cur ]);\n            }\n            else {\n                if (!cur) unexpected();\n                cur.push(statement());\n            }\n        }\n        next();\n        return a;\n    });\n\n    function try_() {\n        var body = block_(), bcatch, bfinally;\n        if (is(\"keyword\", \"catch\")) {\n            next();\n            expect(\"(\");\n            if (!is(\"name\"))\n                croak(\"Name expected\");\n            var name = S.token.value;\n            next();\n            expect(\")\");\n            bcatch = [ name, block_() ];\n        }\n        if (is(\"keyword\", \"finally\")) {\n            next();\n            bfinally = block_();\n        }\n        if (!bcatch && !bfinally)\n            croak(\"Missing catch/finally blocks\");\n        return as(\"try\", body, bcatch, bfinally);\n    };\n\n    function vardefs(no_in) {\n        var a = [];\n        for (;;) {\n            if (!is(\"name\"))\n                unexpected();\n            var name = S.token.value;\n            next();\n            if (is(\"operator\", \"=\")) {\n                next();\n                a.push([ name, expression(false, no_in) ]);\n            } else {\n                a.push([ name ]);\n            }\n            if (!is(\"punc\", \",\"))\n                break;\n            next();\n        }\n        return a;\n    };\n\n    function var_(no_in) {\n        return as(\"var\", vardefs(no_in));\n    };\n\n    function const_() {\n        return as(\"const\", vardefs());\n    };\n\n    function new_() {\n        var newexp = expr_atom(false), args;\n        if (is(\"punc\", \"(\")) {\n            next();\n            args = expr_list(\")\");\n        } else {\n            args = [];\n        }\n        return subscripts(as(\"new\", newexp, args), true);\n    };\n\n    var expr_atom = maybe_embed_tokens(function(allow_calls) {\n        if (is(\"operator\", \"new\")) {\n            next();\n            return new_();\n        }\n        if (is(\"punc\")) {\n            switch (S.token.value) {\n              case \"(\":\n                next();\n                return subscripts(prog1(expression, curry(expect, \")\")), allow_calls);\n              case \"[\":\n                next();\n                return subscripts(array_(), allow_calls);\n              case \"{\":\n                next();\n                return subscripts(object_(), allow_calls);\n            }\n            unexpected();\n        }\n        if (is(\"keyword\", \"function\")) {\n            next();\n            return subscripts(function_(false), allow_calls);\n        }\n        if (HOP(ATOMIC_START_TOKEN, S.token.type)) {\n            var atom = S.token.type == \"regexp\"\n                ? as(\"regexp\", S.token.value[0], S.token.value[1])\n                : as(S.token.type, S.token.value);\n            return subscripts(prog1(atom, next), allow_calls);\n        }\n        unexpected();\n    });\n\n    function expr_list(closing, allow_trailing_comma, allow_empty) {\n        var first = true, a = [];\n        while (!is(\"punc\", closing)) {\n            if (first) first = false; else expect(\",\");\n            if (allow_trailing_comma && is(\"punc\", closing)) break;\n            if (is(\"punc\", \",\") && allow_empty) {\n                a.push([ \"atom\", \"undefined\" ]);\n            } else {\n                a.push(expression(false));\n            }\n        }\n        next();\n        return a;\n    };\n\n    function array_() {\n        return as(\"array\", expr_list(\"]\", !exigent_mode, true));\n    };\n\n    function object_() {\n        var first = true, a = [];\n        while (!is(\"punc\", \"}\")) {\n            if (first) first = false; else expect(\",\");\n            if (!exigent_mode && is(\"punc\", \"}\"))\n                // allow trailing comma\n                break;\n            var type = S.token.type;\n            var name = as_property_name();\n            if (type == \"name\" && (name == \"get\" || name == \"set\") && !is(\"punc\", \":\")) {\n                a.push([ as_name(), function_(false), name ]);\n            } else {\n                expect(\":\");\n                a.push([ name, expression(false) ]);\n            }\n        }\n        next();\n        return as(\"object\", a);\n    };\n\n    function as_property_name() {\n        switch (S.token.type) {\n          case \"num\":\n          case \"string\":\n            return prog1(S.token.value, next);\n        }\n        return as_name();\n    };\n\n    function as_name() {\n        switch (S.token.type) {\n          case \"name\":\n          case \"operator\":\n          case \"keyword\":\n          case \"atom\":\n            return prog1(S.token.value, next);\n          default:\n            unexpected();\n        }\n    };\n\n    function subscripts(expr, allow_calls) {\n        if (is(\"punc\", \".\")) {\n            next();\n            return subscripts(as(\"dot\", expr, as_name()), allow_calls);\n        }\n        if (is(\"punc\", \"[\")) {\n            next();\n            return subscripts(as(\"sub\", expr, prog1(expression, curry(expect, \"]\"))), allow_calls);\n        }\n        if (allow_calls && is(\"punc\", \"(\")) {\n            next();\n            return subscripts(as(\"call\", expr, expr_list(\")\")), true);\n        }\n        return expr;\n    };\n\n    function maybe_unary(allow_calls) {\n        if (is(\"operator\") && HOP(UNARY_PREFIX, S.token.value)) {\n            return make_unary(\"unary-prefix\",\n                              prog1(S.token.value, next),\n                              maybe_unary(allow_calls));\n        }\n        var val = expr_atom(allow_calls);\n        while (is(\"operator\") && HOP(UNARY_POSTFIX, S.token.value) && !S.token.nlb) {\n            val = make_unary(\"unary-postfix\", S.token.value, val);\n            next();\n        }\n        return val;\n    };\n\n    function make_unary(tag, op, expr) {\n        if ((op == \"++\" || op == \"--\") && !is_assignable(expr))\n            croak(\"Invalid use of \" + op + \" operator\");\n        return as(tag, op, expr);\n    };\n\n    function expr_op(left, min_prec, no_in) {\n        var op = is(\"operator\") ? S.token.value : null;\n        if (op && op == \"in\" && no_in) op = null;\n        var prec = op != null ? PRECEDENCE[op] : null;\n        if (prec != null && prec > min_prec) {\n            next();\n            var right = expr_op(maybe_unary(true), prec, no_in);\n            return expr_op(as(\"binary\", op, left, right), min_prec, no_in);\n        }\n        return left;\n    };\n\n    function expr_ops(no_in) {\n        return expr_op(maybe_unary(true), 0, no_in);\n    };\n\n    function maybe_conditional(no_in) {\n        var expr = expr_ops(no_in);\n        if (is(\"operator\", \"?\")) {\n            next();\n            var yes = expression(false);\n            expect(\":\");\n            return as(\"conditional\", expr, yes, expression(false, no_in));\n        }\n        return expr;\n    };\n\n    function is_assignable(expr) {\n        if (!exigent_mode) return true;\n        switch (expr[0]+\"\") {\n          case \"dot\":\n          case \"sub\":\n          case \"new\":\n          case \"call\":\n            return true;\n          case \"name\":\n            return expr[1] != \"this\";\n        }\n    };\n\n    function maybe_assign(no_in) {\n        var left = maybe_conditional(no_in), val = S.token.value;\n        if (is(\"operator\") && HOP(ASSIGNMENT, val)) {\n            if (is_assignable(left)) {\n                next();\n                return as(\"assign\", ASSIGNMENT[val], left, maybe_assign(no_in));\n            }\n            croak(\"Invalid assignment\");\n        }\n        return left;\n    };\n\n    var expression = maybe_embed_tokens(function(commas, no_in) {\n        if (arguments.length == 0)\n            commas = true;\n        var expr = maybe_assign(no_in);\n        if (commas && is(\"punc\", \",\")) {\n            next();\n            return as(\"seq\", expr, expression(true, no_in));\n        }\n        return expr;\n    });\n\n    function in_loop(cont) {\n        try {\n            ++S.in_loop;\n            return cont();\n        } finally {\n            --S.in_loop;\n        }\n    };\n\n    return as(\"toplevel\", (function(a){\n        while (!is(\"eof\"))\n            a.push(statement());\n        return a;\n    })([]));\n\n};\n\n/* -----[ Utilities ]----- */\n\nfunction curry(f) {\n    var args = slice(arguments, 1);\n    return function() { return f.apply(this, args.concat(slice(arguments))); };\n};\n\nfunction prog1(ret) {\n    if (ret instanceof Function)\n        ret = ret();\n    for (var i = 1, n = arguments.length; --n > 0; ++i)\n        arguments[i]();\n    return ret;\n};\n\nfunction array_to_hash(a) {\n    var ret = {};\n    for (var i = 0; i < a.length; ++i)\n        ret[a[i]] = true;\n    return ret;\n};\n\nfunction slice(a, start) {\n    return Array.prototype.slice.call(a, start || 0);\n};\n\nfunction characters(str) {\n    return str.split(\"\");\n};\n\nfunction member(name, array) {\n    for (var i = array.length; --i >= 0;)\n        if (array[i] == name)\n            return true;\n    return false;\n};\n\nfunction HOP(obj, prop) {\n    return Object.prototype.hasOwnProperty.call(obj, prop);\n};\n\nvar warn = function() {};\n\n/* -----[ Exports ]----- */\n\nexports.tokenizer = tokenizer;\nexports.parse = parse;\nexports.slice = slice;\nexports.curry = curry;\nexports.member = member;\nexports.array_to_hash = array_to_hash;\nexports.PRECEDENCE = PRECEDENCE;\nexports.KEYWORDS_ATOM = KEYWORDS_ATOM;\nexports.RESERVED_WORDS = RESERVED_WORDS;\nexports.KEYWORDS = KEYWORDS;\nexports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN;\nexports.OPERATORS = OPERATORS;\nexports.is_alphanumeric_char = is_alphanumeric_char;\nexports.is_identifier_start = is_identifier_start;\nexports.is_identifier_char = is_identifier_char;\nexports.set_logger = function(logger) {\n    warn = logger;\n};\n\n// Local variables:\n// js-indent-level: 4\n// End:\n"
  },
  {
    "path": "lib/process.js",
    "content": "/***********************************************************************\n\n  A JavaScript tokenizer / parser / beautifier / compressor.\n\n  This version is suitable for Node.js.  With minimal changes (the\n  exports stuff) it should work on any JS platform.\n\n  This file implements some AST processors.  They work on data built\n  by parse-js.\n\n  Exported functions:\n\n    - ast_mangle(ast, options) -- mangles the variable/function names\n      in the AST.  Returns an AST.\n\n    - ast_squeeze(ast) -- employs various optimizations to make the\n      final generated code even smaller.  Returns an AST.\n\n    - gen_code(ast, options) -- generates JS code from the AST.  Pass\n      true (or an object, see the code for some options) as second\n      argument to get \"pretty\" (indented) code.\n\n  -------------------------------- (C) ---------------------------------\n\n                           Author: Mihai Bazon\n                         <mihai.bazon@gmail.com>\n                       http://mihai.bazon.net/blog\n\n  Distributed under the BSD license:\n\n    Copyright 2010 (c) Mihai Bazon <mihai.bazon@gmail.com>\n\n    Redistribution and use in source and binary forms, with or without\n    modification, are permitted provided that the following conditions\n    are met:\n\n        * Redistributions of source code must retain the above\n          copyright notice, this list of conditions and the following\n          disclaimer.\n\n        * Redistributions in binary form must reproduce the above\n          copyright notice, this list of conditions and the following\n          disclaimer in the documentation and/or other materials\n          provided with the distribution.\n\n    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n    TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n    THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n    SUCH DAMAGE.\n\n ***********************************************************************/\n\nvar jsp = require(\"./parse-js\"),\n    curry = jsp.curry,\n    slice = jsp.slice,\n    member = jsp.member,\n    is_identifier_char = jsp.is_identifier_char,\n    PRECEDENCE = jsp.PRECEDENCE,\n    OPERATORS = jsp.OPERATORS;\n\n/* -----[ helper for AST traversal ]----- */\n\nfunction ast_walker() {\n    function _vardefs(defs) {\n        return [ this[0], MAP(defs, function(def){\n            var a = [ def[0] ];\n            if (def.length > 1)\n                a[1] = walk(def[1]);\n            return a;\n        }) ];\n    };\n    function _block(statements) {\n        var out = [ this[0] ];\n        if (statements != null)\n            out.push(MAP(statements, walk));\n        return out;\n    };\n    var walkers = {\n        \"string\": function(str) {\n            return [ this[0], str ];\n        },\n        \"num\": function(num) {\n            return [ this[0], num ];\n        },\n        \"name\": function(name) {\n            return [ this[0], name ];\n        },\n        \"toplevel\": function(statements) {\n            return [ this[0], MAP(statements, walk) ];\n        },\n        \"block\": _block,\n        \"splice\": _block,\n        \"var\": _vardefs,\n        \"const\": _vardefs,\n        \"try\": function(t, c, f) {\n            return [\n                this[0],\n                MAP(t, walk),\n                c != null ? [ c[0], MAP(c[1], walk) ] : null,\n                f != null ? MAP(f, walk) : null\n            ];\n        },\n        \"throw\": function(expr) {\n            return [ this[0], walk(expr) ];\n        },\n        \"new\": function(ctor, args) {\n            return [ this[0], walk(ctor), MAP(args, walk) ];\n        },\n        \"switch\": function(expr, body) {\n            return [ this[0], walk(expr), MAP(body, function(branch){\n                return [ branch[0] ? walk(branch[0]) : null,\n                         MAP(branch[1], walk) ];\n            }) ];\n        },\n        \"break\": function(label) {\n            return [ this[0], label ];\n        },\n        \"continue\": function(label) {\n            return [ this[0], label ];\n        },\n        \"conditional\": function(cond, t, e) {\n            return [ this[0], walk(cond), walk(t), walk(e) ];\n        },\n        \"assign\": function(op, lvalue, rvalue) {\n            return [ this[0], op, walk(lvalue), walk(rvalue) ];\n        },\n        \"dot\": function(expr) {\n            return [ this[0], walk(expr) ].concat(slice(arguments, 1));\n        },\n        \"call\": function(expr, args) {\n            return [ this[0], walk(expr), MAP(args, walk) ];\n        },\n        \"function\": function(name, args, body) {\n            return [ this[0], name, args.slice(), MAP(body, walk) ];\n        },\n        \"debugger\": function() {\n            return [ this[0] ];\n        },\n        \"defun\": function(name, args, body) {\n            return [ this[0], name, args.slice(), MAP(body, walk) ];\n        },\n        \"if\": function(conditional, t, e) {\n            return [ this[0], walk(conditional), walk(t), walk(e) ];\n        },\n        \"for\": function(init, cond, step, block) {\n            return [ this[0], walk(init), walk(cond), walk(step), walk(block) ];\n        },\n        \"for-in\": function(vvar, key, hash, block) {\n            return [ this[0], walk(vvar), walk(key), walk(hash), walk(block) ];\n        },\n        \"while\": function(cond, block) {\n            return [ this[0], walk(cond), walk(block) ];\n        },\n        \"do\": function(cond, block) {\n            return [ this[0], walk(cond), walk(block) ];\n        },\n        \"return\": function(expr) {\n            return [ this[0], walk(expr) ];\n        },\n        \"binary\": function(op, left, right) {\n            return [ this[0], op, walk(left), walk(right) ];\n        },\n        \"unary-prefix\": function(op, expr) {\n            return [ this[0], op, walk(expr) ];\n        },\n        \"unary-postfix\": function(op, expr) {\n            return [ this[0], op, walk(expr) ];\n        },\n        \"sub\": function(expr, subscript) {\n            return [ this[0], walk(expr), walk(subscript) ];\n        },\n        \"object\": function(props) {\n            return [ this[0], MAP(props, function(p){\n                return p.length == 2\n                    ? [ p[0], walk(p[1]) ]\n                    : [ p[0], walk(p[1]), p[2] ]; // get/set-ter\n            }) ];\n        },\n        \"regexp\": function(rx, mods) {\n            return [ this[0], rx, mods ];\n        },\n        \"array\": function(elements) {\n            return [ this[0], MAP(elements, walk) ];\n        },\n        \"stat\": function(stat) {\n            return [ this[0], walk(stat) ];\n        },\n        \"seq\": function() {\n            return [ this[0] ].concat(MAP(slice(arguments), walk));\n        },\n        \"label\": function(name, block) {\n            return [ this[0], name, walk(block) ];\n        },\n        \"with\": function(expr, block) {\n            return [ this[0], walk(expr), walk(block) ];\n        },\n        \"atom\": function(name) {\n            return [ this[0], name ];\n        },\n        \"directive\": function(dir) {\n            return [ this[0], dir ];\n        }\n    };\n\n    var user = {};\n    var stack = [];\n    function walk(ast) {\n        if (ast == null)\n            return null;\n        try {\n            stack.push(ast);\n            var type = ast[0];\n            var gen = user[type];\n            if (gen) {\n                var ret = gen.apply(ast, ast.slice(1));\n                if (ret != null)\n                    return ret;\n            }\n            gen = walkers[type];\n            return gen.apply(ast, ast.slice(1));\n        } finally {\n            stack.pop();\n        }\n    };\n\n    function dive(ast) {\n        if (ast == null)\n            return null;\n        try {\n            stack.push(ast);\n            return walkers[ast[0]].apply(ast, ast.slice(1));\n        } finally {\n            stack.pop();\n        }\n    };\n\n    function with_walkers(walkers, cont){\n        var save = {}, i;\n        for (i in walkers) if (HOP(walkers, i)) {\n            save[i] = user[i];\n            user[i] = walkers[i];\n        }\n        var ret = cont();\n        for (i in save) if (HOP(save, i)) {\n            if (!save[i]) delete user[i];\n            else user[i] = save[i];\n        }\n        return ret;\n    };\n\n    return {\n        walk: walk,\n        dive: dive,\n        with_walkers: with_walkers,\n        parent: function() {\n            return stack[stack.length - 2]; // last one is current node\n        },\n        stack: function() {\n            return stack;\n        }\n    };\n};\n\n/* -----[ Scope and mangling ]----- */\n\nfunction Scope(parent) {\n    this.names = {};        // names defined in this scope\n    this.mangled = {};      // mangled names (orig.name => mangled)\n    this.rev_mangled = {};  // reverse lookup (mangled => orig.name)\n    this.cname = -1;        // current mangled name\n    this.refs = {};         // names referenced from this scope\n    this.uses_with = false; // will become TRUE if with() is detected in this or any subscopes\n    this.uses_eval = false; // will become TRUE if eval() is detected in this or any subscopes\n    this.directives = [];   // directives activated from this scope\n    this.parent = parent;   // parent scope\n    this.children = [];     // sub-scopes\n    if (parent) {\n        this.level = parent.level + 1;\n        parent.children.push(this);\n    } else {\n        this.level = 0;\n    }\n};\n\nfunction base54_digits() {\n    if (typeof DIGITS_OVERRIDE_FOR_TESTING != \"undefined\")\n        return DIGITS_OVERRIDE_FOR_TESTING;\n    else\n        return \"etnrisouaflchpdvmgybwESxTNCkLAOM_DPHBjFIqRUzWXV$JKQGYZ0516372984\";\n}\n\nvar base54 = (function(){\n    var DIGITS = base54_digits();\n    return function(num) {\n        var ret = \"\", base = 54;\n        do {\n            ret += DIGITS.charAt(num % base);\n            num = Math.floor(num / base);\n            base = 64;\n        } while (num > 0);\n        return ret;\n    };\n})();\n\nScope.prototype = {\n    has: function(name) {\n        for (var s = this; s; s = s.parent)\n            if (HOP(s.names, name))\n                return s;\n    },\n    has_mangled: function(mname) {\n        for (var s = this; s; s = s.parent)\n            if (HOP(s.rev_mangled, mname))\n                return s;\n    },\n    toJSON: function() {\n        return {\n            names: this.names,\n            uses_eval: this.uses_eval,\n            uses_with: this.uses_with\n        };\n    },\n\n    next_mangled: function() {\n        // we must be careful that the new mangled name:\n        //\n        // 1. doesn't shadow a mangled name from a parent\n        //    scope, unless we don't reference the original\n        //    name from this scope OR from any sub-scopes!\n        //    This will get slow.\n        //\n        // 2. doesn't shadow an original name from a parent\n        //    scope, in the event that the name is not mangled\n        //    in the parent scope and we reference that name\n        //    here OR IN ANY SUBSCOPES!\n        //\n        // 3. doesn't shadow a name that is referenced but not\n        //    defined (possibly global defined elsewhere).\n        for (;;) {\n            var m = base54(++this.cname), prior;\n\n            // case 1.\n            prior = this.has_mangled(m);\n            if (prior && this.refs[prior.rev_mangled[m]] === prior)\n                continue;\n\n            // case 2.\n            prior = this.has(m);\n            if (prior && prior !== this && this.refs[m] === prior && !prior.has_mangled(m))\n                continue;\n\n            // case 3.\n            if (HOP(this.refs, m) && this.refs[m] == null)\n                continue;\n\n            // I got \"do\" once. :-/\n            if (!is_identifier(m))\n                continue;\n\n            return m;\n        }\n    },\n    set_mangle: function(name, m) {\n        this.rev_mangled[m] = name;\n        return this.mangled[name] = m;\n    },\n    get_mangled: function(name, newMangle) {\n        if (this.uses_eval || this.uses_with) return name; // no mangle if eval or with is in use\n        var s = this.has(name);\n        if (!s) return name; // not in visible scope, no mangle\n        if (HOP(s.mangled, name)) return s.mangled[name]; // already mangled in this scope\n        if (!newMangle) return name;                      // not found and no mangling requested\n        return s.set_mangle(name, s.next_mangled());\n    },\n    references: function(name) {\n        return name && !this.parent || this.uses_with || this.uses_eval || this.refs[name];\n    },\n    define: function(name, type) {\n        if (name != null) {\n            if (type == \"var\" || !HOP(this.names, name))\n                this.names[name] = type || \"var\";\n            return name;\n        }\n    },\n    active_directive: function(dir) {\n        return member(dir, this.directives) || this.parent && this.parent.active_directive(dir);\n    }\n};\n\nfunction ast_add_scope(ast) {\n\n    var current_scope = null;\n    var w = ast_walker(), walk = w.walk;\n    var having_eval = [];\n\n    function with_new_scope(cont) {\n        current_scope = new Scope(current_scope);\n        current_scope.labels = new Scope();\n        var ret = current_scope.body = cont();\n        ret.scope = current_scope;\n        current_scope = current_scope.parent;\n        return ret;\n    };\n\n    function define(name, type) {\n        return current_scope.define(name, type);\n    };\n\n    function reference(name) {\n        current_scope.refs[name] = true;\n    };\n\n    function _lambda(name, args, body) {\n        var is_defun = this[0] == \"defun\";\n        return [ this[0], is_defun ? define(name, \"defun\") : name, args, with_new_scope(function(){\n            if (!is_defun) define(name, \"lambda\");\n            MAP(args, function(name){ define(name, \"arg\") });\n            return MAP(body, walk);\n        })];\n    };\n\n    function _vardefs(type) {\n        return function(defs) {\n            MAP(defs, function(d){\n                define(d[0], type);\n                if (d[1]) reference(d[0]);\n            });\n        };\n    };\n\n    function _breacont(label) {\n        if (label)\n            current_scope.labels.refs[label] = true;\n    };\n\n    return with_new_scope(function(){\n        // process AST\n        var ret = w.with_walkers({\n            \"function\": _lambda,\n            \"defun\": _lambda,\n            \"label\": function(name, stat) { current_scope.labels.define(name) },\n            \"break\": _breacont,\n            \"continue\": _breacont,\n            \"with\": function(expr, block) {\n                for (var s = current_scope; s; s = s.parent)\n                    s.uses_with = true;\n            },\n            \"var\": _vardefs(\"var\"),\n            \"const\": _vardefs(\"const\"),\n            \"try\": function(t, c, f) {\n                if (c != null) return [\n                    this[0],\n                    MAP(t, walk),\n                    [ define(c[0], \"catch\"), MAP(c[1], walk) ],\n                    f != null ? MAP(f, walk) : null\n                ];\n            },\n            \"name\": function(name) {\n                if (name == \"eval\")\n                    having_eval.push(current_scope);\n                reference(name);\n            }\n        }, function(){\n            return walk(ast);\n        });\n\n        // the reason why we need an additional pass here is\n        // that names can be used prior to their definition.\n\n        // scopes where eval was detected and their parents\n        // are marked with uses_eval, unless they define the\n        // \"eval\" name.\n        MAP(having_eval, function(scope){\n            if (!scope.has(\"eval\")) while (scope) {\n                scope.uses_eval = true;\n                scope = scope.parent;\n            }\n        });\n\n        // for referenced names it might be useful to know\n        // their origin scope.  current_scope here is the\n        // toplevel one.\n        function fixrefs(scope, i) {\n            // do children first; order shouldn't matter\n            for (i = scope.children.length; --i >= 0;)\n                fixrefs(scope.children[i]);\n            for (i in scope.refs) if (HOP(scope.refs, i)) {\n                // find origin scope and propagate the reference to origin\n                for (var origin = scope.has(i), s = scope; s; s = s.parent) {\n                    s.refs[i] = origin;\n                    if (s === origin) break;\n                }\n            }\n        };\n        fixrefs(current_scope);\n\n        return ret;\n    });\n\n};\n\n/* -----[ mangle names ]----- */\n\nfunction ast_mangle(ast, options) {\n    var w = ast_walker(), walk = w.walk, scope;\n    options = defaults(options, {\n        mangle       : true,\n        toplevel     : false,\n        defines      : null,\n        except       : null,\n        no_functions : false\n    });\n\n    function get_mangled(name, newMangle) {\n        if (!options.mangle) return name;\n        if (!options.toplevel && !scope.parent) return name; // don't mangle toplevel\n        if (options.except && member(name, options.except))\n            return name;\n        if (options.no_functions && HOP(scope.names, name) &&\n            (scope.names[name] == 'defun' || scope.names[name] == 'lambda'))\n            return name;\n        return scope.get_mangled(name, newMangle);\n    };\n\n    function get_define(name) {\n        if (options.defines) {\n            // we always lookup a defined symbol for the current scope FIRST, so declared\n            // vars trump a DEFINE symbol, but if no such var is found, then match a DEFINE value\n            if (!scope.has(name)) {\n                if (HOP(options.defines, name)) {\n                    return options.defines[name];\n                }\n            }\n            return null;\n        }\n    };\n\n    function _lambda(name, args, body) {\n        if (!options.no_functions && options.mangle) {\n            var is_defun = this[0] == \"defun\", extra;\n            if (name) {\n                if (is_defun) name = get_mangled(name);\n                else if (body.scope.references(name)) {\n                    extra = {};\n                    if (!(scope.uses_eval || scope.uses_with))\n                        name = extra[name] = scope.next_mangled();\n                    else\n                        extra[name] = name;\n                }\n                else name = null;\n            }\n        }\n        body = with_scope(body.scope, function(){\n            args = MAP(args, function(name){ return get_mangled(name) });\n            return MAP(body, walk);\n        }, extra);\n        return [ this[0], name, args, body ];\n    };\n\n    function with_scope(s, cont, extra) {\n        var _scope = scope;\n        scope = s;\n        if (extra) for (var i in extra) if (HOP(extra, i)) {\n            s.set_mangle(i, extra[i]);\n        }\n        for (var i in s.names) if (HOP(s.names, i)) {\n            get_mangled(i, true);\n        }\n        var ret = cont();\n        ret.scope = s;\n        scope = _scope;\n        return ret;\n    };\n\n    function _vardefs(defs) {\n        return [ this[0], MAP(defs, function(d){\n            return [ get_mangled(d[0]), walk(d[1]) ];\n        }) ];\n    };\n\n    function _breacont(label) {\n        if (label) return [ this[0], scope.labels.get_mangled(label) ];\n    };\n\n    return w.with_walkers({\n        \"function\": _lambda,\n        \"defun\": function() {\n            // move function declarations to the top when\n            // they are not in some block.\n            var ast = _lambda.apply(this, arguments);\n            switch (w.parent()[0]) {\n              case \"toplevel\":\n              case \"function\":\n              case \"defun\":\n                return MAP.at_top(ast);\n            }\n            return ast;\n        },\n        \"label\": function(label, stat) {\n            if (scope.labels.refs[label]) return [\n                this[0],\n                scope.labels.get_mangled(label, true),\n                walk(stat)\n            ];\n            return walk(stat);\n        },\n        \"break\": _breacont,\n        \"continue\": _breacont,\n        \"var\": _vardefs,\n        \"const\": _vardefs,\n        \"name\": function(name) {\n            return get_define(name) || [ this[0], get_mangled(name) ];\n        },\n        \"try\": function(t, c, f) {\n            return [ this[0],\n                     MAP(t, walk),\n                     c != null ? [ get_mangled(c[0]), MAP(c[1], walk) ] : null,\n                     f != null ? MAP(f, walk) : null ];\n        },\n        \"toplevel\": function(body) {\n            var self = this;\n            return with_scope(self.scope, function(){\n                return [ self[0], MAP(body, walk) ];\n            });\n        },\n        \"directive\": function() {\n            return MAP.at_top(this);\n        }\n    }, function() {\n        return walk(ast_add_scope(ast));\n    });\n};\n\n/* -----[\n   - compress foo[\"bar\"] into foo.bar,\n   - remove block brackets {} where possible\n   - join consecutive var declarations\n   - various optimizations for IFs:\n   - if (cond) foo(); else bar();  ==>  cond?foo():bar();\n   - if (cond) foo();  ==>  cond&&foo();\n   - if (foo) return bar(); else return baz();  ==> return foo?bar():baz(); // also for throw\n   - if (foo) return bar(); else something();  ==> {if(foo)return bar();something()}\n   ]----- */\n\nvar warn = function(){};\n\nfunction best_of(ast1, ast2) {\n    return gen_code(ast1).length > gen_code(ast2[0] == \"stat\" ? ast2[1] : ast2).length ? ast2 : ast1;\n};\n\nfunction last_stat(b) {\n    if (b[0] == \"block\" && b[1] && b[1].length > 0)\n        return b[1][b[1].length - 1];\n    return b;\n}\n\nfunction aborts(t) {\n    if (t) switch (last_stat(t)[0]) {\n      case \"return\":\n      case \"break\":\n      case \"continue\":\n      case \"throw\":\n        return true;\n    }\n};\n\nfunction boolean_expr(expr) {\n    return ( (expr[0] == \"unary-prefix\"\n              && member(expr[1], [ \"!\", \"delete\" ])) ||\n\n             (expr[0] == \"binary\"\n              && member(expr[1], [ \"in\", \"instanceof\", \"==\", \"!=\", \"===\", \"!==\", \"<\", \"<=\", \">=\", \">\" ])) ||\n\n             (expr[0] == \"binary\"\n              && member(expr[1], [ \"&&\", \"||\" ])\n              && boolean_expr(expr[2])\n              && boolean_expr(expr[3])) ||\n\n             (expr[0] == \"conditional\"\n              && boolean_expr(expr[2])\n              && boolean_expr(expr[3])) ||\n\n             (expr[0] == \"assign\"\n              && expr[1] === true\n              && boolean_expr(expr[3])) ||\n\n             (expr[0] == \"seq\"\n              && boolean_expr(expr[expr.length - 1]))\n           );\n};\n\nfunction empty(b) {\n    return !b || (b[0] == \"block\" && (!b[1] || b[1].length == 0));\n};\n\nfunction is_string(node) {\n    return (node[0] == \"string\" ||\n            node[0] == \"unary-prefix\" && node[1] == \"typeof\" ||\n            node[0] == \"binary\" && node[1] == \"+\" &&\n            (is_string(node[2]) || is_string(node[3])));\n};\n\nvar when_constant = (function(){\n\n    var $NOT_CONSTANT = {};\n\n    // this can only evaluate constant expressions.  If it finds anything\n    // not constant, it throws $NOT_CONSTANT.\n    function evaluate(expr) {\n        switch (expr[0]) {\n          case \"string\":\n          case \"num\":\n            return expr[1];\n          case \"name\":\n          case \"atom\":\n            switch (expr[1]) {\n              case \"true\": return true;\n              case \"false\": return false;\n              case \"null\": return null;\n            }\n            break;\n          case \"unary-prefix\":\n            switch (expr[1]) {\n              case \"!\": return !evaluate(expr[2]);\n              case \"typeof\": return typeof evaluate(expr[2]);\n              case \"~\": return ~evaluate(expr[2]);\n              case \"-\": return -evaluate(expr[2]);\n              case \"+\": return +evaluate(expr[2]);\n            }\n            break;\n          case \"binary\":\n            var left = expr[2], right = expr[3];\n            switch (expr[1]) {\n              case \"&&\"         : return evaluate(left) &&         evaluate(right);\n              case \"||\"         : return evaluate(left) ||         evaluate(right);\n              case \"|\"          : return evaluate(left) |          evaluate(right);\n              case \"&\"          : return evaluate(left) &          evaluate(right);\n              case \"^\"          : return evaluate(left) ^          evaluate(right);\n              case \"+\"          : return evaluate(left) +          evaluate(right);\n              case \"*\"          : return evaluate(left) *          evaluate(right);\n              case \"/\"          : return evaluate(left) /          evaluate(right);\n              case \"%\"          : return evaluate(left) %          evaluate(right);\n              case \"-\"          : return evaluate(left) -          evaluate(right);\n              case \"<<\"         : return evaluate(left) <<         evaluate(right);\n              case \">>\"         : return evaluate(left) >>         evaluate(right);\n              case \">>>\"        : return evaluate(left) >>>        evaluate(right);\n              case \"==\"         : return evaluate(left) ==         evaluate(right);\n              case \"===\"        : return evaluate(left) ===        evaluate(right);\n              case \"!=\"         : return evaluate(left) !=         evaluate(right);\n              case \"!==\"        : return evaluate(left) !==        evaluate(right);\n              case \"<\"          : return evaluate(left) <          evaluate(right);\n              case \"<=\"         : return evaluate(left) <=         evaluate(right);\n              case \">\"          : return evaluate(left) >          evaluate(right);\n              case \">=\"         : return evaluate(left) >=         evaluate(right);\n              case \"in\"         : return evaluate(left) in         evaluate(right);\n              case \"instanceof\" : return evaluate(left) instanceof evaluate(right);\n            }\n        }\n        throw $NOT_CONSTANT;\n    };\n\n    return function(expr, yes, no) {\n        try {\n            var val = evaluate(expr), ast;\n            switch (typeof val) {\n              case \"string\": ast =  [ \"string\", val ]; break;\n              case \"number\": ast =  [ \"num\", val ]; break;\n              case \"boolean\": ast =  [ \"name\", String(val) ]; break;\n              default:\n                if (val === null) { ast = [ \"atom\", \"null\" ]; break; }\n                throw new Error(\"Can't handle constant of type: \" + (typeof val));\n            }\n            return yes.call(expr, ast, val);\n        } catch(ex) {\n            if (ex === $NOT_CONSTANT) {\n                if (expr[0] == \"binary\"\n                    && (expr[1] == \"===\" || expr[1] == \"!==\")\n                    && ((is_string(expr[2]) && is_string(expr[3]))\n                        || (boolean_expr(expr[2]) && boolean_expr(expr[3])))) {\n                    expr[1] = expr[1].substr(0, 2);\n                }\n                else if (no && expr[0] == \"binary\"\n                         && (expr[1] == \"||\" || expr[1] == \"&&\")) {\n                    // the whole expression is not constant but the lval may be...\n                    try {\n                        var lval = evaluate(expr[2]);\n                        expr = ((expr[1] == \"&&\" && (lval ? expr[3] : lval))    ||\n                                (expr[1] == \"||\" && (lval ? lval    : expr[3])) ||\n                                expr);\n                    } catch(ex2) {\n                        // IGNORE... lval is not constant\n                    }\n                }\n                return no ? no.call(expr, expr) : null;\n            }\n            else throw ex;\n        }\n    };\n\n})();\n\nfunction warn_unreachable(ast) {\n    if (!empty(ast))\n        warn(\"Dropping unreachable code: \" + gen_code(ast, true));\n};\n\nfunction prepare_ifs(ast) {\n    var w = ast_walker(), walk = w.walk;\n    // In this first pass, we rewrite ifs which abort with no else with an\n    // if-else.  For example:\n    //\n    // if (x) {\n    //     blah();\n    //     return y;\n    // }\n    // foobar();\n    //\n    // is rewritten into:\n    //\n    // if (x) {\n    //     blah();\n    //     return y;\n    // } else {\n    //     foobar();\n    // }\n    function redo_if(statements) {\n        statements = MAP(statements, walk);\n\n        for (var i = 0; i < statements.length; ++i) {\n            var fi = statements[i];\n            if (fi[0] != \"if\") continue;\n\n            if (fi[3]) continue;\n\n            var t = fi[2];\n            if (!aborts(t)) continue;\n\n            var conditional = walk(fi[1]);\n\n            var e_body = redo_if(statements.slice(i + 1));\n            var e = e_body.length == 1 ? e_body[0] : [ \"block\", e_body ];\n\n            return statements.slice(0, i).concat([ [\n                fi[0],          // \"if\"\n                conditional,    // conditional\n                t,              // then\n                e               // else\n            ] ]);\n        }\n\n        return statements;\n    };\n\n    function redo_if_lambda(name, args, body) {\n        body = redo_if(body);\n        return [ this[0], name, args, body ];\n    };\n\n    function redo_if_block(statements) {\n        return [ this[0], statements != null ? redo_if(statements) : null ];\n    };\n\n    return w.with_walkers({\n        \"defun\": redo_if_lambda,\n        \"function\": redo_if_lambda,\n        \"block\": redo_if_block,\n        \"splice\": redo_if_block,\n        \"toplevel\": function(statements) {\n            return [ this[0], redo_if(statements) ];\n        },\n        \"try\": function(t, c, f) {\n            return [\n                this[0],\n                redo_if(t),\n                c != null ? [ c[0], redo_if(c[1]) ] : null,\n                f != null ? redo_if(f) : null\n            ];\n        }\n    }, function() {\n        return walk(ast);\n    });\n};\n\nfunction for_side_effects(ast, handler) {\n    var w = ast_walker(), walk = w.walk;\n    var $stop = {}, $restart = {};\n    function stop() { throw $stop };\n    function restart() { throw $restart };\n    function found(){ return handler.call(this, this, w, stop, restart) };\n    function unary(op) {\n        if (op == \"++\" || op == \"--\")\n            return found.apply(this, arguments);\n    };\n    function binary(op) {\n        if (op == \"&&\" || op == \"||\")\n            return found.apply(this, arguments);\n    };\n    return w.with_walkers({\n        \"try\": found,\n        \"throw\": found,\n        \"return\": found,\n        \"new\": found,\n        \"switch\": found,\n        \"break\": found,\n        \"continue\": found,\n        \"assign\": found,\n        \"call\": found,\n        \"if\": found,\n        \"for\": found,\n        \"for-in\": found,\n        \"while\": found,\n        \"do\": found,\n        \"unary-prefix\": unary,\n        \"unary-postfix\": unary,\n        \"conditional\": found,\n        \"binary\": binary,\n        \"defun\": found\n    }, function(){\n        while (true) try {\n            walk(ast);\n            break;\n        } catch(ex) {\n            if (ex === $stop) break;\n            if (ex === $restart) continue;\n            throw ex;\n        }\n    });\n};\n\nfunction ast_lift_variables(ast) {\n    var w = ast_walker(), walk = w.walk, scope;\n    function do_body(body, env) {\n        var _scope = scope;\n        scope = env;\n        body = MAP(body, walk);\n        var hash = {}, names = MAP(env.names, function(type, name){\n            if (type != \"var\") return MAP.skip;\n            if (!env.references(name)) return MAP.skip;\n            hash[name] = true;\n            return [ name ];\n        });\n        if (names.length > 0) {\n            // looking for assignments to any of these variables.\n            // we can save considerable space by moving the definitions\n            // in the var declaration.\n            for_side_effects([ \"block\", body ], function(ast, walker, stop, restart) {\n                if (ast[0] == \"assign\"\n                    && ast[1] === true\n                    && ast[2][0] == \"name\"\n                    && HOP(hash, ast[2][1])) {\n                    // insert the definition into the var declaration\n                    for (var i = names.length; --i >= 0;) {\n                        if (names[i][0] == ast[2][1]) {\n                            if (names[i][1]) // this name already defined, we must stop\n                                stop();\n                            names[i][1] = ast[3]; // definition\n                            names.push(names.splice(i, 1)[0]);\n                            break;\n                        }\n                    }\n                    // remove this assignment from the AST.\n                    var p = walker.parent();\n                    if (p[0] == \"seq\") {\n                        var a = p[2];\n                        a.unshift(0, p.length);\n                        p.splice.apply(p, a);\n                    }\n                    else if (p[0] == \"stat\") {\n                        p.splice(0, p.length, \"block\"); // empty statement\n                    }\n                    else {\n                        stop();\n                    }\n                    restart();\n                }\n                stop();\n            });\n            body.unshift([ \"var\", names ]);\n        }\n        scope = _scope;\n        return body;\n    };\n    function _vardefs(defs) {\n        var ret = null;\n        for (var i = defs.length; --i >= 0;) {\n            var d = defs[i];\n            if (!d[1]) continue;\n            d = [ \"assign\", true, [ \"name\", d[0] ], d[1] ];\n            if (ret == null) ret = d;\n            else ret = [ \"seq\", d, ret ];\n        }\n        if (ret == null && w.parent()[0] != \"for\") {\n            if (w.parent()[0] == \"for-in\")\n                return [ \"name\", defs[0][0] ];\n            return MAP.skip;\n        }\n        return [ \"stat\", ret ];\n    };\n    function _toplevel(body) {\n        return [ this[0], do_body(body, this.scope) ];\n    };\n    return w.with_walkers({\n        \"function\": function(name, args, body){\n            for (var i = args.length; --i >= 0 && !body.scope.references(args[i]);)\n                args.pop();\n            if (!body.scope.references(name)) name = null;\n            return [ this[0], name, args, do_body(body, body.scope) ];\n        },\n        \"defun\": function(name, args, body){\n            if (!scope.references(name)) return MAP.skip;\n            for (var i = args.length; --i >= 0 && !body.scope.references(args[i]);)\n                args.pop();\n            return [ this[0], name, args, do_body(body, body.scope) ];\n        },\n        \"var\": _vardefs,\n        \"toplevel\": _toplevel\n    }, function(){\n        return walk(ast_add_scope(ast));\n    });\n};\n\nfunction ast_squeeze(ast, options) {\n    ast = squeeze_1(ast, options);\n    ast = squeeze_2(ast, options);\n    return ast;\n};\n\nfunction squeeze_1(ast, options) {\n    options = defaults(options, {\n        make_seqs   : true,\n        dead_code   : true,\n        no_warnings : false,\n        keep_comps  : true,\n        unsafe      : false\n    });\n\n    var w = ast_walker(), walk = w.walk, scope;\n\n    function negate(c) {\n        var not_c = [ \"unary-prefix\", \"!\", c ];\n        switch (c[0]) {\n          case \"unary-prefix\":\n            return c[1] == \"!\" && boolean_expr(c[2]) ? c[2] : not_c;\n          case \"seq\":\n            c = slice(c);\n            c[c.length - 1] = negate(c[c.length - 1]);\n            return c;\n          case \"conditional\":\n            return best_of(not_c, [ \"conditional\", c[1], negate(c[2]), negate(c[3]) ]);\n          case \"binary\":\n            var op = c[1], left = c[2], right = c[3];\n            if (!options.keep_comps) switch (op) {\n              case \"<=\"  : return [ \"binary\", \">\", left, right ];\n              case \"<\"   : return [ \"binary\", \">=\", left, right ];\n              case \">=\"  : return [ \"binary\", \"<\", left, right ];\n              case \">\"   : return [ \"binary\", \"<=\", left, right ];\n            }\n            switch (op) {\n              case \"==\"  : return [ \"binary\", \"!=\", left, right ];\n              case \"!=\"  : return [ \"binary\", \"==\", left, right ];\n              case \"===\" : return [ \"binary\", \"!==\", left, right ];\n              case \"!==\" : return [ \"binary\", \"===\", left, right ];\n              case \"&&\"  : return best_of(not_c, [ \"binary\", \"||\", negate(left), negate(right) ]);\n              case \"||\"  : return best_of(not_c, [ \"binary\", \"&&\", negate(left), negate(right) ]);\n            }\n            break;\n        }\n        return not_c;\n    };\n\n    function make_conditional(c, t, e) {\n        var make_real_conditional = function() {\n            if (c[0] == \"unary-prefix\" && c[1] == \"!\") {\n                return e ? [ \"conditional\", c[2], e, t ] : [ \"binary\", \"||\", c[2], t ];\n            } else {\n                return e ? best_of(\n                    [ \"conditional\", c, t, e ],\n                    [ \"conditional\", negate(c), e, t ]\n                ) : [ \"binary\", \"&&\", c, t ];\n            }\n        };\n        // shortcut the conditional if the expression has a constant value\n        return when_constant(c, function(ast, val){\n            warn_unreachable(val ? e : t);\n            return          (val ? t : e);\n        }, make_real_conditional);\n    };\n\n    function rmblock(block) {\n        if (block != null && block[0] == \"block\" && block[1]) {\n            if (block[1].length == 1)\n                block = block[1][0];\n            else if (block[1].length == 0)\n                block = [ \"block\" ];\n        }\n        return block;\n    };\n\n    function _lambda(name, args, body) {\n        return [ this[0], name, args, tighten(body, \"lambda\") ];\n    };\n\n    // this function does a few things:\n    // 1. discard useless blocks\n    // 2. join consecutive var declarations\n    // 3. remove obviously dead code\n    // 4. transform consecutive statements using the comma operator\n    // 5. if block_type == \"lambda\" and it detects constructs like if(foo) return ... - rewrite like if (!foo) { ... }\n    function tighten(statements, block_type) {\n        statements = MAP(statements, walk);\n\n        statements = statements.reduce(function(a, stat){\n            if (stat[0] == \"block\") {\n                if (stat[1]) {\n                    a.push.apply(a, stat[1]);\n                }\n            } else {\n                a.push(stat);\n            }\n            return a;\n        }, []);\n\n        statements = (function(a, prev){\n            statements.forEach(function(cur){\n                if (prev && ((cur[0] == \"var\" && prev[0] == \"var\") ||\n                             (cur[0] == \"const\" && prev[0] == \"const\"))) {\n                    prev[1] = prev[1].concat(cur[1]);\n                } else {\n                    a.push(cur);\n                    prev = cur;\n                }\n            });\n            return a;\n        })([]);\n\n        if (options.dead_code) statements = (function(a, has_quit){\n            statements.forEach(function(st){\n                if (has_quit) {\n                    if (st[0] == \"function\" || st[0] == \"defun\") {\n                        a.push(st);\n                    }\n                    else if (st[0] == \"var\" || st[0] == \"const\") {\n                        if (!options.no_warnings)\n                            warn(\"Variables declared in unreachable code\");\n                        st[1] = MAP(st[1], function(def){\n                            if (def[1] && !options.no_warnings)\n                                warn_unreachable([ \"assign\", true, [ \"name\", def[0] ], def[1] ]);\n                            return [ def[0] ];\n                        });\n                        a.push(st);\n                    }\n                    else if (!options.no_warnings)\n                        warn_unreachable(st);\n                }\n                else {\n                    a.push(st);\n                    if (member(st[0], [ \"return\", \"throw\", \"break\", \"continue\" ]))\n                        has_quit = true;\n                }\n            });\n            return a;\n        })([]);\n\n        if (options.make_seqs) statements = (function(a, prev) {\n            statements.forEach(function(cur){\n                if (prev && prev[0] == \"stat\" && cur[0] == \"stat\") {\n                    prev[1] = [ \"seq\", prev[1], cur[1] ];\n                } else {\n                    a.push(cur);\n                    prev = cur;\n                }\n            });\n            if (a.length >= 2\n                && a[a.length-2][0] == \"stat\"\n                && (a[a.length-1][0] == \"return\" || a[a.length-1][0] == \"throw\")\n                && a[a.length-1][1])\n            {\n                a.splice(a.length - 2, 2,\n                         [ a[a.length-1][0],\n                           [ \"seq\", a[a.length-2][1], a[a.length-1][1] ]]);\n            }\n            return a;\n        })([]);\n\n        // this increases jQuery by 1K.  Probably not such a good idea after all..\n        // part of this is done in prepare_ifs anyway.\n        // if (block_type == \"lambda\") statements = (function(i, a, stat){\n        //         while (i < statements.length) {\n        //                 stat = statements[i++];\n        //                 if (stat[0] == \"if\" && !stat[3]) {\n        //                         if (stat[2][0] == \"return\" && stat[2][1] == null) {\n        //                                 a.push(make_if(negate(stat[1]), [ \"block\", statements.slice(i) ]));\n        //                                 break;\n        //                         }\n        //                         var last = last_stat(stat[2]);\n        //                         if (last[0] == \"return\" && last[1] == null) {\n        //                                 a.push(make_if(stat[1], [ \"block\", stat[2][1].slice(0, -1) ], [ \"block\", statements.slice(i) ]));\n        //                                 break;\n        //                         }\n        //                 }\n        //                 a.push(stat);\n        //         }\n        //         return a;\n        // })(0, []);\n\n        return statements;\n    };\n\n    function make_if(c, t, e) {\n        return when_constant(c, function(ast, val){\n            if (val) {\n                t = walk(t);\n                warn_unreachable(e);\n                return t || [ \"block\" ];\n            } else {\n                e = walk(e);\n                warn_unreachable(t);\n                return e || [ \"block\" ];\n            }\n        }, function() {\n            return make_real_if(c, t, e);\n        });\n    };\n\n    function abort_else(c, t, e) {\n        var ret = [ [ \"if\", negate(c), e ] ];\n        if (t[0] == \"block\") {\n            if (t[1]) ret = ret.concat(t[1]);\n        } else {\n            ret.push(t);\n        }\n        return walk([ \"block\", ret ]);\n    };\n\n    function make_real_if(c, t, e) {\n        c = walk(c);\n        t = walk(t);\n        e = walk(e);\n\n        if (empty(e) && empty(t))\n            return [ \"stat\", c ];\n\n        if (empty(t)) {\n            c = negate(c);\n            t = e;\n            e = null;\n        } else if (empty(e)) {\n            e = null;\n        } else {\n            // if we have both else and then, maybe it makes sense to switch them?\n            (function(){\n                var a = gen_code(c);\n                var n = negate(c);\n                var b = gen_code(n);\n                if (b.length < a.length) {\n                    var tmp = t;\n                    t = e;\n                    e = tmp;\n                    c = n;\n                }\n            })();\n        }\n        var ret = [ \"if\", c, t, e ];\n        if (t[0] == \"if\" && empty(t[3]) && empty(e)) {\n            ret = best_of(ret, walk([ \"if\", [ \"binary\", \"&&\", c, t[1] ], t[2] ]));\n        }\n        else if (t[0] == \"stat\") {\n            if (e) {\n                if (e[0] == \"stat\")\n                    ret = best_of(ret, [ \"stat\", make_conditional(c, t[1], e[1]) ]);\n                else if (aborts(e))\n                    ret = abort_else(c, t, e);\n            }\n            else {\n                ret = best_of(ret, [ \"stat\", make_conditional(c, t[1]) ]);\n            }\n        }\n        else if (e && t[0] == e[0] && (t[0] == \"return\" || t[0] == \"throw\") && t[1] && e[1]) {\n            ret = best_of(ret, [ t[0], make_conditional(c, t[1], e[1] ) ]);\n        }\n        else if (e && aborts(t)) {\n            ret = [ [ \"if\", c, t ] ];\n            if (e[0] == \"block\") {\n                if (e[1]) ret = ret.concat(e[1]);\n            }\n            else {\n                ret.push(e);\n            }\n            ret = walk([ \"block\", ret ]);\n        }\n        else if (t && aborts(e)) {\n            ret = abort_else(c, t, e);\n        }\n        return ret;\n    };\n\n    function _do_while(cond, body) {\n        return when_constant(cond, function(cond, val){\n            if (!val) {\n                warn_unreachable(body);\n                return [ \"block\" ];\n            } else {\n                return [ \"for\", null, null, null, walk(body) ];\n            }\n        });\n    };\n\n    return w.with_walkers({\n        \"sub\": function(expr, subscript) {\n            if (subscript[0] == \"string\") {\n                var name = subscript[1];\n                if (is_identifier(name))\n                    return [ \"dot\", walk(expr), name ];\n                else if (/^[1-9][0-9]*$/.test(name) || name === \"0\")\n                    return [ \"sub\", walk(expr), [ \"num\", parseInt(name, 10) ] ];\n            }\n        },\n        \"if\": make_if,\n        \"toplevel\": function(body) {\n            return [ \"toplevel\", tighten(body) ];\n        },\n        \"switch\": function(expr, body) {\n            var last = body.length - 1;\n            return [ \"switch\", walk(expr), MAP(body, function(branch, i){\n                var block = tighten(branch[1]);\n                if (i == last && block.length > 0) {\n                    var node = block[block.length - 1];\n                    if (node[0] == \"break\" && !node[1])\n                        block.pop();\n                }\n                return [ branch[0] ? walk(branch[0]) : null, block ];\n            }) ];\n        },\n        \"function\": _lambda,\n        \"defun\": _lambda,\n        \"block\": function(body) {\n            if (body) return rmblock([ \"block\", tighten(body) ]);\n        },\n        \"binary\": function(op, left, right) {\n            return when_constant([ \"binary\", op, walk(left), walk(right) ], function yes(c){\n                return best_of(walk(c), this);\n            }, function no() {\n                return function(){\n                    if(op != \"==\" && op != \"!=\") return;\n                    var l = walk(left), r = walk(right);\n                    if(l && l[0] == \"unary-prefix\" && l[1] == \"!\" && l[2][0] == \"num\")\n                        left = ['num', +!l[2][1]];\n                    else if (r && r[0] == \"unary-prefix\" && r[1] == \"!\" && r[2][0] == \"num\")\n                        right = ['num', +!r[2][1]];\n                    return [\"binary\", op, left, right];\n                }() || this;\n            });\n        },\n        \"conditional\": function(c, t, e) {\n            return make_conditional(walk(c), walk(t), walk(e));\n        },\n        \"try\": function(t, c, f) {\n            return [\n                \"try\",\n                tighten(t),\n                c != null ? [ c[0], tighten(c[1]) ] : null,\n                f != null ? tighten(f) : null\n            ];\n        },\n        \"unary-prefix\": function(op, expr) {\n            expr = walk(expr);\n            var ret = [ \"unary-prefix\", op, expr ];\n            if (op == \"!\")\n                ret = best_of(ret, negate(expr));\n            return when_constant(ret, function(ast, val){\n                return walk(ast); // it's either true or false, so minifies to !0 or !1\n            }, function() { return ret });\n        },\n        \"name\": function(name) {\n            switch (name) {\n              case \"true\": return [ \"unary-prefix\", \"!\", [ \"num\", 0 ]];\n              case \"false\": return [ \"unary-prefix\", \"!\", [ \"num\", 1 ]];\n            }\n        },\n        \"while\": _do_while,\n        \"assign\": function(op, lvalue, rvalue) {\n            lvalue = walk(lvalue);\n            rvalue = walk(rvalue);\n            var okOps = [ '+', '-', '/', '*', '%', '>>', '<<', '>>>', '|', '^', '&' ];\n            if (op === true && lvalue[0] === \"name\" && rvalue[0] === \"binary\" &&\n                ~okOps.indexOf(rvalue[1]) && rvalue[2][0] === \"name\" &&\n                rvalue[2][1] === lvalue[1]) {\n                return [ this[0], rvalue[1], lvalue, rvalue[3] ]\n            }\n            return [ this[0], op, lvalue, rvalue ];\n        },\n        \"call\": function(expr, args) {\n            expr = walk(expr);\n            if (options.unsafe && expr[0] == \"dot\" && expr[1][0] == \"string\" && expr[2] == \"toString\") {\n                return expr[1];\n            }\n            return [ this[0], expr,  MAP(args, walk) ];\n        },\n        \"num\": function (num) {\n            if (!isFinite(num))\n                return [ \"binary\", \"/\", num === 1 / 0\n                         ? [ \"num\", 1 ] : num === -1 / 0\n                         ? [ \"unary-prefix\", \"-\", [ \"num\", 1 ] ]\n                         : [ \"num\", 0 ], [ \"num\", 0 ] ];\n\n            return [ this[0], num ];\n        }\n    }, function() {\n        return walk(prepare_ifs(walk(prepare_ifs(ast))));\n    });\n};\n\nfunction squeeze_2(ast, options) {\n    var w = ast_walker(), walk = w.walk, scope;\n    function with_scope(s, cont) {\n        var save = scope, ret;\n        scope = s;\n        ret = cont();\n        scope = save;\n        return ret;\n    };\n    function lambda(name, args, body) {\n        return [ this[0], name, args, with_scope(body.scope, curry(MAP, body, walk)) ];\n    };\n    return w.with_walkers({\n        \"directive\": function(dir) {\n            if (scope.active_directive(dir))\n                return [ \"block\" ];\n            scope.directives.push(dir);\n        },\n        \"toplevel\": function(body) {\n            return [ this[0], with_scope(this.scope, curry(MAP, body, walk)) ];\n        },\n        \"function\": lambda,\n        \"defun\": lambda\n    }, function(){\n        return walk(ast_add_scope(ast));\n    });\n};\n\n/* -----[ re-generate code from the AST ]----- */\n\nvar DOT_CALL_NO_PARENS = jsp.array_to_hash([\n    \"name\",\n    \"array\",\n    \"object\",\n    \"string\",\n    \"dot\",\n    \"sub\",\n    \"call\",\n    \"regexp\",\n    \"defun\"\n]);\n\nfunction make_string(str, ascii_only) {\n    var dq = 0, sq = 0;\n    str = str.replace(/[\\\\\\b\\f\\n\\r\\t\\x22\\x27\\u2028\\u2029\\0]/g, function(s){\n        switch (s) {\n          case \"\\\\\": return \"\\\\\\\\\";\n          case \"\\b\": return \"\\\\b\";\n          case \"\\f\": return \"\\\\f\";\n          case \"\\n\": return \"\\\\n\";\n          case \"\\r\": return \"\\\\r\";\n          case \"\\u2028\": return \"\\\\u2028\";\n          case \"\\u2029\": return \"\\\\u2029\";\n          case '\"': ++dq; return '\"';\n          case \"'\": ++sq; return \"'\";\n          case \"\\0\": return \"\\\\0\";\n        }\n        return s;\n    });\n    if (ascii_only) str = to_ascii(str);\n    if (dq > sq) return \"'\" + str.replace(/\\x27/g, \"\\\\'\") + \"'\";\n    else return '\"' + str.replace(/\\x22/g, '\\\\\"') + '\"';\n};\n\nfunction to_ascii(str) {\n    return str.replace(/[\\u0080-\\uffff]/g, function(ch) {\n        var code = ch.charCodeAt(0).toString(16);\n        while (code.length < 4) code = \"0\" + code;\n        return \"\\\\u\" + code;\n    });\n};\n\nvar SPLICE_NEEDS_BRACKETS = jsp.array_to_hash([ \"if\", \"while\", \"do\", \"for\", \"for-in\", \"with\" ]);\n\nfunction gen_code(ast, options) {\n    options = defaults(options, {\n        indent_start : 0,\n        indent_level : 4,\n        quote_keys   : false,\n        space_colon  : false,\n        beautify     : false,\n        ascii_only   : false,\n        inline_script: false\n    });\n    var beautify = !!options.beautify;\n    var indentation = 0,\n    newline = beautify ? \"\\n\" : \"\",\n    space = beautify ? \" \" : \"\";\n\n    function encode_string(str) {\n        var ret = make_string(str, options.ascii_only);\n        if (options.inline_script)\n            ret = ret.replace(/<\\x2fscript([>\\/\\t\\n\\f\\r ])/gi, \"<\\\\/script$1\");\n        return ret;\n    };\n\n    function make_name(name) {\n        name = name.toString();\n        if (options.ascii_only)\n            name = to_ascii(name);\n        return name;\n    };\n\n    function indent(line) {\n        if (line == null)\n            line = \"\";\n        if (beautify)\n            line = repeat_string(\" \", options.indent_start + indentation * options.indent_level) + line;\n        return line;\n    };\n\n    function with_indent(cont, incr) {\n        if (incr == null) incr = 1;\n        indentation += incr;\n        try { return cont.apply(null, slice(arguments, 1)); }\n        finally { indentation -= incr; }\n    };\n\n    function last_char(str) {\n        str = str.toString();\n        return str.charAt(str.length - 1);\n    };\n\n    function first_char(str) {\n        return str.toString().charAt(0);\n    };\n\n    function add_spaces(a) {\n        if (beautify)\n            return a.join(\" \");\n        var b = [];\n        for (var i = 0; i < a.length; ++i) {\n            var next = a[i + 1];\n            b.push(a[i]);\n            if (next &&\n                ((is_identifier_char(last_char(a[i])) && (is_identifier_char(first_char(next))\n                                                          || first_char(next) == \"\\\\\")) ||\n                 (/[\\+\\-]$/.test(a[i].toString()) && /^[\\+\\-]/.test(next.toString()) ||\n                 last_char(a[i]) == \"/\" && first_char(next) == \"/\"))) {\n                b.push(\" \");\n            }\n        }\n        return b.join(\"\");\n    };\n\n    function add_commas(a) {\n        return a.join(\",\" + space);\n    };\n\n    function parenthesize(expr) {\n        var gen = make(expr);\n        for (var i = 1; i < arguments.length; ++i) {\n            var el = arguments[i];\n            if ((el instanceof Function && el(expr)) || expr[0] == el)\n                return \"(\" + gen + \")\";\n        }\n        return gen;\n    };\n\n    function best_of(a) {\n        if (a.length == 1) {\n            return a[0];\n        }\n        if (a.length == 2) {\n            var b = a[1];\n            a = a[0];\n            return a.length <= b.length ? a : b;\n        }\n        return best_of([ a[0], best_of(a.slice(1)) ]);\n    };\n\n    function needs_parens(expr) {\n        if (expr[0] == \"function\" || expr[0] == \"object\") {\n            // dot/call on a literal function requires the\n            // function literal itself to be parenthesized\n            // only if it's the first \"thing\" in a\n            // statement.  This means that the parent is\n            // \"stat\", but it could also be a \"seq\" and\n            // we're the first in this \"seq\" and the\n            // parent is \"stat\", and so on.  Messy stuff,\n            // but it worths the trouble.\n            var a = slice(w.stack()), self = a.pop(), p = a.pop();\n            while (p) {\n                if (p[0] == \"stat\") return true;\n                if (((p[0] == \"seq\" || p[0] == \"call\" || p[0] == \"dot\" || p[0] == \"sub\" || p[0] == \"conditional\") && p[1] === self) ||\n                    ((p[0] == \"binary\" || p[0] == \"assign\" || p[0] == \"unary-postfix\") && p[2] === self)) {\n                    self = p;\n                    p = a.pop();\n                } else {\n                    return false;\n                }\n            }\n        }\n        return !HOP(DOT_CALL_NO_PARENS, expr[0]);\n    };\n\n    function make_num(num) {\n        var str = num.toString(10), a = [ str.replace(/^0\\./, \".\").replace('e+', 'e') ], m;\n        if (Math.floor(num) === num) {\n            if (num >= 0) {\n                a.push(\"0x\" + num.toString(16).toLowerCase(), // probably pointless\n                       \"0\" + num.toString(8)); // same.\n            } else {\n                a.push(\"-0x\" + (-num).toString(16).toLowerCase(), // probably pointless\n                       \"-0\" + (-num).toString(8)); // same.\n            }\n            if ((m = /^(.*?)(0+)$/.exec(num))) {\n                a.push(m[1] + \"e\" + m[2].length);\n            }\n        } else if ((m = /^0?\\.(0+)(.*)$/.exec(num))) {\n            a.push(m[2] + \"e-\" + (m[1].length + m[2].length),\n                   str.substr(str.indexOf(\".\")));\n        }\n        return best_of(a);\n    };\n\n    var w = ast_walker();\n    var make = w.walk;\n    return w.with_walkers({\n        \"string\": encode_string,\n        \"num\": make_num,\n        \"name\": make_name,\n        \"debugger\": function(){ return \"debugger;\" },\n        \"toplevel\": function(statements) {\n            return make_block_statements(statements)\n                .join(newline + newline);\n        },\n        \"splice\": function(statements) {\n            var parent = w.parent();\n            if (HOP(SPLICE_NEEDS_BRACKETS, parent)) {\n                // we need block brackets in this case\n                return make_block.apply(this, arguments);\n            } else {\n                return MAP(make_block_statements(statements, true),\n                           function(line, i) {\n                               // the first line is already indented\n                               return i > 0 ? indent(line) : line;\n                           }).join(newline);\n            }\n        },\n        \"block\": make_block,\n        \"var\": function(defs) {\n            return \"var \" + add_commas(MAP(defs, make_1vardef)) + \";\";\n        },\n        \"const\": function(defs) {\n            return \"const \" + add_commas(MAP(defs, make_1vardef)) + \";\";\n        },\n        \"try\": function(tr, ca, fi) {\n            var out = [ \"try\", make_block(tr) ];\n            if (ca) out.push(\"catch\", \"(\" + ca[0] + \")\", make_block(ca[1]));\n            if (fi) out.push(\"finally\", make_block(fi));\n            return add_spaces(out);\n        },\n        \"throw\": function(expr) {\n            return add_spaces([ \"throw\", make(expr) ]) + \";\";\n        },\n        \"new\": function(ctor, args) {\n            args = args.length > 0 ? \"(\" + add_commas(MAP(args, function(expr){\n                return parenthesize(expr, \"seq\");\n            })) + \")\" : \"\";\n            return add_spaces([ \"new\", parenthesize(ctor, \"seq\", \"binary\", \"conditional\", \"assign\", function(expr){\n                var w = ast_walker(), has_call = {};\n                try {\n                    w.with_walkers({\n                        \"call\": function() { throw has_call },\n                        \"function\": function() { return this }\n                    }, function(){\n                        w.walk(expr);\n                    });\n                } catch(ex) {\n                    if (ex === has_call)\n                        return true;\n                    throw ex;\n                }\n            }) + args ]);\n        },\n        \"switch\": function(expr, body) {\n            return add_spaces([ \"switch\", \"(\" + make(expr) + \")\", make_switch_block(body) ]);\n        },\n        \"break\": function(label) {\n            var out = \"break\";\n            if (label != null)\n                out += \" \" + make_name(label);\n            return out + \";\";\n        },\n        \"continue\": function(label) {\n            var out = \"continue\";\n            if (label != null)\n                out += \" \" + make_name(label);\n            return out + \";\";\n        },\n        \"conditional\": function(co, th, el) {\n            return add_spaces([ parenthesize(co, \"assign\", \"seq\", \"conditional\"), \"?\",\n                                parenthesize(th, \"seq\"), \":\",\n                                parenthesize(el, \"seq\") ]);\n        },\n        \"assign\": function(op, lvalue, rvalue) {\n            if (op && op !== true) op += \"=\";\n            else op = \"=\";\n            return add_spaces([ make(lvalue), op, parenthesize(rvalue, \"seq\") ]);\n        },\n        \"dot\": function(expr) {\n            var out = make(expr), i = 1;\n            if (expr[0] == \"num\") {\n                if (!/[a-f.]/i.test(out))\n                    out += \".\";\n            } else if (expr[0] != \"function\" && needs_parens(expr))\n                out = \"(\" + out + \")\";\n            while (i < arguments.length)\n                out += \".\" + make_name(arguments[i++]);\n            return out;\n        },\n        \"call\": function(func, args) {\n            var f = make(func);\n            // cannot simply test the first and/or the last characters in the genetic case,\n            // because the called expression might look like e.g. `(x || y) && (u || v)`.\n            var already_wrapped = (func[0] == \"function\" && f.charAt(0) == \"(\");\n            if (!already_wrapped && needs_parens(func))\n                f = \"(\" + f + \")\";\n            return f + \"(\" + add_commas(MAP(args, function(expr){\n                return parenthesize(expr, \"seq\");\n            })) + \")\";\n        },\n        \"function\": make_function,\n        \"defun\": make_function,\n        \"if\": function(co, th, el) {\n            var out = [ \"if\", \"(\" + make(co) + \")\", el ? make_then(th) : make(th) ];\n            if (el) {\n                out.push(\"else\", make(el));\n            }\n            return add_spaces(out);\n        },\n        \"for\": function(init, cond, step, block) {\n            var out = [ \"for\" ];\n            init = (init != null ? make(init) : \"\").replace(/;*\\s*$/, \";\" + space);\n            cond = (cond != null ? make(cond) : \"\").replace(/;*\\s*$/, \";\" + space);\n            step = (step != null ? make(step) : \"\").replace(/;*\\s*$/, \"\");\n            var args = init + cond + step;\n            if (args == \"; ; \") args = \";;\";\n            out.push(\"(\" + args + \")\", make(block));\n            return add_spaces(out);\n        },\n        \"for-in\": function(vvar, key, hash, block) {\n            return add_spaces([ \"for\", \"(\" +\n                                (vvar ? make(vvar).replace(/;+$/, \"\") : make(key)),\n                                \"in\",\n                                make(hash) + \")\", make(block) ]);\n        },\n        \"while\": function(condition, block) {\n            return add_spaces([ \"while\", \"(\" + make(condition) + \")\", make(block) ]);\n        },\n        \"do\": function(condition, block) {\n            return add_spaces([ \"do\", make(block), \"while\", \"(\" + make(condition) + \")\" ]) + \";\";\n        },\n        \"return\": function(expr) {\n            var out = [ \"return\" ];\n            if (expr != null) out.push(make(expr));\n            return add_spaces(out) + \";\";\n        },\n        \"binary\": function(operator, lvalue, rvalue) {\n            var left = make(lvalue), right = make(rvalue);\n            // XXX: I'm pretty sure other cases will bite here.\n            //      we need to be smarter.\n            //      adding parens all the time is the safest bet.\n            if (member(lvalue[0], [ \"assign\", \"conditional\", \"seq\" ]) ||\n                lvalue[0] == \"binary\" && PRECEDENCE[operator] > PRECEDENCE[lvalue[1]] ||\n                lvalue[0] == \"function\" && needs_parens(this)) {\n                left = \"(\" + left + \")\";\n            }\n            if (member(rvalue[0], [ \"assign\", \"conditional\", \"seq\" ]) ||\n                rvalue[0] == \"binary\" && PRECEDENCE[operator] >= PRECEDENCE[rvalue[1]] &&\n                !(rvalue[1] == operator && member(operator, [ \"&&\", \"||\", \"*\" ]))) {\n                right = \"(\" + right + \")\";\n            }\n            else if (!beautify && options.inline_script && (operator == \"<\" || operator == \"<<\")\n                     && rvalue[0] == \"regexp\" && /^script/i.test(rvalue[1])) {\n                right = \" \" + right;\n            }\n            return add_spaces([ left, operator, right ]);\n        },\n        \"unary-prefix\": function(operator, expr) {\n            var val = make(expr);\n            if (!(expr[0] == \"num\" || (expr[0] == \"unary-prefix\" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr)))\n                val = \"(\" + val + \")\";\n            return operator + (jsp.is_alphanumeric_char(operator.charAt(0)) ? \" \" : \"\") + val;\n        },\n        \"unary-postfix\": function(operator, expr) {\n            var val = make(expr);\n            if (!(expr[0] == \"num\" || (expr[0] == \"unary-postfix\" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr)))\n                val = \"(\" + val + \")\";\n            return val + operator;\n        },\n        \"sub\": function(expr, subscript) {\n            var hash = make(expr);\n            if (needs_parens(expr))\n                hash = \"(\" + hash + \")\";\n            return hash + \"[\" + make(subscript) + \"]\";\n        },\n        \"object\": function(props) {\n            var obj_needs_parens = needs_parens(this);\n            if (props.length == 0)\n                return obj_needs_parens ? \"({})\" : \"{}\";\n            var out = \"{\" + newline + with_indent(function(){\n                return MAP(props, function(p){\n                    if (p.length == 3) {\n                        // getter/setter.  The name is in p[0], the arg.list in p[1][2], the\n                        // body in p[1][3] and type (\"get\" / \"set\") in p[2].\n                        return indent(make_function(p[0], p[1][2], p[1][3], p[2], true));\n                    }\n                    var key = p[0], val = parenthesize(p[1], \"seq\");\n                    if (options.quote_keys) {\n                        key = encode_string(key);\n                    } else if ((typeof key == \"number\" || !beautify && +key + \"\" == key)\n                               && parseFloat(key) >= 0) {\n                        key = make_num(+key);\n                    } else if (!is_identifier(key)) {\n                        key = encode_string(key);\n                    }\n                    return indent(add_spaces(beautify && options.space_colon\n                                             ? [ key, \":\", val ]\n                                             : [ key + \":\", val ]));\n                }).join(\",\" + newline);\n            }) + newline + indent(\"}\");\n            return obj_needs_parens ? \"(\" + out + \")\" : out;\n        },\n        \"regexp\": function(rx, mods) {\n            if (options.ascii_only) rx = to_ascii(rx);\n            return \"/\" + rx + \"/\" + mods;\n        },\n        \"array\": function(elements) {\n            if (elements.length == 0) return \"[]\";\n            return add_spaces([ \"[\", add_commas(MAP(elements, function(el, i){\n                if (!beautify && el[0] == \"atom\" && el[1] == \"undefined\") return i === elements.length - 1 ? \",\" : \"\";\n                return parenthesize(el, \"seq\");\n            })), \"]\" ]);\n        },\n        \"stat\": function(stmt) {\n            return stmt != null\n                ? make(stmt).replace(/;*\\s*$/, \";\")\n                : \";\";\n        },\n        \"seq\": function() {\n            return add_commas(MAP(slice(arguments), make));\n        },\n        \"label\": function(name, block) {\n            return add_spaces([ make_name(name), \":\", make(block) ]);\n        },\n        \"with\": function(expr, block) {\n            return add_spaces([ \"with\", \"(\" + make(expr) + \")\", make(block) ]);\n        },\n        \"atom\": function(name) {\n            return make_name(name);\n        },\n        \"directive\": function(dir) {\n            return make_string(dir) + \";\";\n        }\n    }, function(){ return make(ast) });\n\n    // The squeezer replaces \"block\"-s that contain only a single\n    // statement with the statement itself; technically, the AST\n    // is correct, but this can create problems when we output an\n    // IF having an ELSE clause where the THEN clause ends in an\n    // IF *without* an ELSE block (then the outer ELSE would refer\n    // to the inner IF).  This function checks for this case and\n    // adds the block brackets if needed.\n    function make_then(th) {\n        if (th == null) return \";\";\n        if (th[0] == \"do\") {\n            // https://github.com/mishoo/UglifyJS/issues/#issue/57\n            // IE croaks with \"syntax error\" on code like this:\n            //     if (foo) do ... while(cond); else ...\n            // we need block brackets around do/while\n            return make_block([ th ]);\n        }\n        var b = th;\n        while (true) {\n            var type = b[0];\n            if (type == \"if\") {\n                if (!b[3])\n                    // no else, we must add the block\n                    return make([ \"block\", [ th ]]);\n                b = b[3];\n            }\n            else if (type == \"while\" || type == \"do\") b = b[2];\n            else if (type == \"for\" || type == \"for-in\") b = b[4];\n            else break;\n        }\n        return make(th);\n    };\n\n    function make_function(name, args, body, keyword, no_parens) {\n        var out = keyword || \"function\";\n        if (name) {\n            out += \" \" + make_name(name);\n        }\n        out += \"(\" + add_commas(MAP(args, make_name)) + \")\";\n        out = add_spaces([ out, make_block(body) ]);\n        return (!no_parens && needs_parens(this)) ? \"(\" + out + \")\" : out;\n    };\n\n    function must_has_semicolon(node) {\n        switch (node[0]) {\n          case \"with\":\n          case \"while\":\n            return empty(node[2]) || must_has_semicolon(node[2]);\n          case \"for\":\n          case \"for-in\":\n            return empty(node[4]) || must_has_semicolon(node[4]);\n          case \"if\":\n            if (empty(node[2]) && !node[3]) return true; // `if' with empty `then' and no `else'\n            if (node[3]) {\n                if (empty(node[3])) return true; // `else' present but empty\n                return must_has_semicolon(node[3]); // dive into the `else' branch\n            }\n            return must_has_semicolon(node[2]); // dive into the `then' branch\n          case \"directive\":\n            return true;\n        }\n    };\n\n    function make_block_statements(statements, noindent) {\n        for (var a = [], last = statements.length - 1, i = 0; i <= last; ++i) {\n            var stat = statements[i];\n            var code = make(stat);\n            if (code != \";\") {\n                if (!beautify && i == last && !must_has_semicolon(stat)) {\n                    code = code.replace(/;+\\s*$/, \"\");\n                }\n                a.push(code);\n            }\n        }\n        return noindent ? a : MAP(a, indent);\n    };\n\n    function make_switch_block(body) {\n        var n = body.length;\n        if (n == 0) return \"{}\";\n        return \"{\" + newline + MAP(body, function(branch, i){\n            var has_body = branch[1].length > 0, code = with_indent(function(){\n                return indent(branch[0]\n                              ? add_spaces([ \"case\", make(branch[0]) + \":\" ])\n                              : \"default:\");\n            }, 0.5) + (has_body ? newline + with_indent(function(){\n                return make_block_statements(branch[1]).join(newline);\n            }) : \"\");\n            if (!beautify && has_body && i < n - 1)\n                code += \";\";\n            return code;\n        }).join(newline) + newline + indent(\"}\");\n    };\n\n    function make_block(statements) {\n        if (!statements) return \";\";\n        if (statements.length == 0) return \"{}\";\n        return \"{\" + newline + with_indent(function(){\n            return make_block_statements(statements).join(newline);\n        }) + newline + indent(\"}\");\n    };\n\n    function make_1vardef(def) {\n        var name = def[0], val = def[1];\n        if (val != null)\n            name = add_spaces([ make_name(name), \"=\", parenthesize(val, \"seq\") ]);\n        return name;\n    };\n\n};\n\nfunction split_lines(code, max_line_length) {\n    var splits = [ 0 ];\n    jsp.parse(function(){\n        var next_token = jsp.tokenizer(code);\n        var last_split = 0;\n        var prev_token;\n        function current_length(tok) {\n            return tok.pos - last_split;\n        };\n        function split_here(tok) {\n            last_split = tok.pos;\n            splits.push(last_split);\n        };\n        function custom(){\n            var tok = next_token.apply(this, arguments);\n            out: {\n                if (prev_token) {\n                    if (prev_token.type == \"keyword\") break out;\n                }\n                if (current_length(tok) > max_line_length) {\n                    switch (tok.type) {\n                      case \"keyword\":\n                      case \"atom\":\n                      case \"name\":\n                      case \"punc\":\n                        split_here(tok);\n                        break out;\n                    }\n                }\n            }\n            prev_token = tok;\n            return tok;\n        };\n        custom.context = function() {\n            return next_token.context.apply(this, arguments);\n        };\n        return custom;\n    }());\n    return splits.map(function(pos, i){\n        return code.substring(pos, splits[i + 1] || code.length);\n    }).join(\"\\n\");\n};\n\n/* -----[ Utilities ]----- */\n\nfunction repeat_string(str, i) {\n    if (i <= 0) return \"\";\n    if (i == 1) return str;\n    var d = repeat_string(str, i >> 1);\n    d += d;\n    if (i & 1) d += str;\n    return d;\n};\n\nfunction defaults(args, defs) {\n    var ret = {};\n    if (args === true)\n        args = {};\n    for (var i in defs) if (HOP(defs, i)) {\n        ret[i] = (args && HOP(args, i)) ? args[i] : defs[i];\n    }\n    return ret;\n};\n\nfunction is_identifier(name) {\n    return /^[a-z_$][a-z0-9_$]*$/i.test(name)\n        && name != \"this\"\n        && !HOP(jsp.KEYWORDS_ATOM, name)\n        && !HOP(jsp.RESERVED_WORDS, name)\n        && !HOP(jsp.KEYWORDS, name);\n};\n\nfunction HOP(obj, prop) {\n    return Object.prototype.hasOwnProperty.call(obj, prop);\n};\n\n// some utilities\n\nvar MAP;\n\n(function(){\n    MAP = function(a, f, o) {\n        var ret = [], top = [], i;\n        function doit() {\n            var val = f.call(o, a[i], i);\n            if (val instanceof AtTop) {\n                val = val.v;\n                if (val instanceof Splice) {\n                    top.push.apply(top, val.v);\n                } else {\n                    top.push(val);\n                }\n            }\n            else if (val != skip) {\n                if (val instanceof Splice) {\n                    ret.push.apply(ret, val.v);\n                } else {\n                    ret.push(val);\n                }\n            }\n        };\n        if (a instanceof Array) for (i = 0; i < a.length; ++i) doit();\n        else for (i in a) if (HOP(a, i)) doit();\n        return top.concat(ret);\n    };\n    MAP.at_top = function(val) { return new AtTop(val) };\n    MAP.splice = function(val) { return new Splice(val) };\n    var skip = MAP.skip = {};\n    function AtTop(val) { this.v = val };\n    function Splice(val) { this.v = val };\n})();\n\n/* -----[ Exports ]----- */\n\nexports.ast_walker = ast_walker;\nexports.ast_mangle = ast_mangle;\nexports.ast_squeeze = ast_squeeze;\nexports.ast_lift_variables = ast_lift_variables;\nexports.gen_code = gen_code;\nexports.ast_add_scope = ast_add_scope;\nexports.set_logger = function(logger) { warn = logger };\nexports.make_string = make_string;\nexports.split_lines = split_lines;\nexports.MAP = MAP;\n\n// keep this last!\nexports.ast_squeeze_more = require(\"./squeeze-more\").ast_squeeze_more;\n\n// Local variables:\n// js-indent-level: 4\n// End:\n"
  },
  {
    "path": "lib/squeeze-more.js",
    "content": "var jsp = require(\"./parse-js\"),\n    pro = require(\"./process\"),\n    slice = jsp.slice,\n    member = jsp.member,\n    curry = jsp.curry,\n    MAP = pro.MAP,\n    PRECEDENCE = jsp.PRECEDENCE,\n    OPERATORS = jsp.OPERATORS;\n\nfunction ast_squeeze_more(ast) {\n    var w = pro.ast_walker(), walk = w.walk, scope;\n    function with_scope(s, cont) {\n        var save = scope, ret;\n        scope = s;\n        ret = cont();\n        scope = save;\n        return ret;\n    };\n    function _lambda(name, args, body) {\n        return [ this[0], name, args, with_scope(body.scope, curry(MAP, body, walk)) ];\n    };\n    return w.with_walkers({\n        \"toplevel\": function(body) {\n            return [ this[0], with_scope(this.scope, curry(MAP, body, walk)) ];\n        },\n        \"function\": _lambda,\n        \"defun\": _lambda,\n        \"new\": function(ctor, args) {\n            if (ctor[0] == \"name\") {\n                if (ctor[1] == \"Array\" && !scope.has(\"Array\")) {\n                    if (args.length != 1) {\n                        return [ \"array\", args ];\n                    } else {\n                        return walk([ \"call\", [ \"name\", \"Array\" ], args ]);\n                    }\n                } else if (ctor[1] == \"Object\" && !scope.has(\"Object\")) {\n                    if (!args.length) {\n                        return [ \"object\", [] ];\n                    } else {\n                        return walk([ \"call\", [ \"name\", \"Object\" ], args ]);\n                    }\n                } else if ((ctor[1] == \"RegExp\" || ctor[1] == \"Function\" || ctor[1] == \"Error\") && !scope.has(ctor[1])) {\n                    return walk([ \"call\", [ \"name\", ctor[1] ], args]);\n                }\n            }\n        },\n        \"call\": function(expr, args) {\n            if (expr[0] == \"dot\" && expr[1][0] == \"string\" && args.length == 1\n                && (args[0][1] > 0 && expr[2] == \"substring\" || expr[2] == \"substr\")) {\n                return [ \"call\", [ \"dot\", expr[1], \"slice\"], args];\n            }\n            if (expr[0] == \"dot\" && expr[2] == \"toString\" && args.length == 0) {\n                // foo.toString()  ==>  foo+\"\"\n                if (expr[1][0] == \"string\") return expr[1];\n                return [ \"binary\", \"+\", expr[1], [ \"string\", \"\" ]];\n            }\n            if (expr[0] == \"name\") {\n                if (expr[1] == \"Array\" && args.length != 1 && !scope.has(\"Array\")) {\n                    return [ \"array\", args ];\n                }\n                if (expr[1] == \"Object\" && !args.length && !scope.has(\"Object\")) {\n                    return [ \"object\", [] ];\n                }\n                if (expr[1] == \"String\" && !scope.has(\"String\")) {\n                    return [ \"binary\", \"+\", args[0], [ \"string\", \"\" ]];\n                }\n            }\n        }\n    }, function() {\n        return walk(pro.ast_add_scope(ast));\n    });\n};\n\nexports.ast_squeeze_more = ast_squeeze_more;\n\n// Local variables:\n// js-indent-level: 4\n// End:\n"
  },
  {
    "path": "package.json",
    "content": "{\n        \"name\"    : \"uglify-js\",\n\n        \"description\" : \"JavaScript parser and compressor/beautifier toolkit\",\n\n        \"author\"  : {\n                \"name\"  : \"Mihai Bazon\",\n                \"email\" : \"mihai.bazon@gmail.com\",\n                \"url\"   : \"http://mihai.bazon.net/blog\"\n        },\n\n        \"version\" : \"1.3.5\",\n\n        \"main\"    : \"./uglify-js.js\",\n\n        \"bin\"     : {\n                \"uglifyjs\" : \"./bin/uglifyjs\"\n        },\n\n        \"repository\": {\n                \"type\": \"git\",\n                \"url\": \"git@github.com:mishoo/UglifyJS.git\"\n        },\n\n        \"devDependencies\": {\n                \"nodeunit\": \"0.7.x\"\n        },\n\n        \"scripts\": {\n          \"test\": \"$(which nodeunit || echo node_modules/nodeunit/bin/nodeunit) test/unit/scripts.js && test/testparser.js && test/testconsolidator.js\"\n        }\n}\n"
  },
  {
    "path": "test/beautify.js",
    "content": "#! /usr/bin/env node\n\nglobal.sys = require(\"sys\");\nvar fs = require(\"fs\");\n\nvar jsp = require(\"../lib/parse-js\");\nvar pro = require(\"../lib/process\");\n\nvar filename = process.argv[2];\nfs.readFile(filename, \"utf8\", function(err, text){\n        try {\n                var ast = time_it(\"parse\", function(){ return jsp.parse(text); });\n                ast = time_it(\"mangle\", function(){ return pro.ast_mangle(ast); });\n                ast = time_it(\"squeeze\", function(){ return pro.ast_squeeze(ast); });\n                var gen = time_it(\"generate\", function(){ return pro.gen_code(ast, false); });\n                sys.puts(gen);\n        } catch(ex) {\n                sys.debug(ex.stack);\n                sys.debug(sys.inspect(ex));\n                sys.debug(JSON.stringify(ex));\n        }\n});\n\nfunction time_it(name, cont) {\n        var t1 = new Date().getTime();\n        try { return cont(); }\n        finally { sys.debug(\"// \" + name + \": \" + ((new Date().getTime() - t1) / 1000).toFixed(3) + \" sec.\"); }\n};\n"
  },
  {
    "path": "test/testconsolidator.js",
    "content": "#! /usr/bin/env node\nglobal.DIGITS_OVERRIDE_FOR_TESTING = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789\";\n\n'use strict';\n/*jshint bitwise:true, curly:true, eqeqeq:true, forin:true, immed:true,\n     latedef:true, newcap:true, noarge:true, noempty:true, nonew:true,\n     onevar:true, plusplus:true, regexp:true, undef:true, strict:true,\n     sub:false, trailing:true */\n\nvar _,\n    /**\n     * NodeJS module for unit testing.\n     * @namespace\n     * @type {!TAssert}\n     * @see http://nodejs.org/docs/v0.6.10/api/all.html#assert\n     */\n    oAssert = (/** @type {!TAssert} */ require('assert')),\n    /**\n     * Consolidates null, Boolean, and String values found inside an\n     * <abbr title=\"abstract syntax tree\">AST</abbr>. The object under test.\n     * @namespace\n     * @type {!TConsolidator}\n     */\n    oConsolidator = (/** @type {!TConsolidator} */ require('../lib/consolidator')),\n    /**\n     * The parser of ECMA-262 found in UglifyJS.\n     * @namespace\n     * @type {!TParser}\n     */\n    oParser = (/** @type {!TParser} */ require('../lib/parse-js')),\n    /**\n     * The processor of <abbr title=\"abstract syntax tree\">AST</abbr>s\n     * found in UglifyJS.\n     * @namespace\n     * @type {!TProcessor}\n     */\n    oProcessor = (/** @type {!TProcessor} */ require('../lib/process')),\n    /**\n     * An instance of an object that allows the traversal of an <abbr\n     * title=\"abstract syntax tree\">AST</abbr>.\n     * @type {!TWalker}\n     */\n    oWalker,\n    /**\n     * A collection of functions for the removal of the scope information\n     * during the traversal of an <abbr title=\"abstract syntax tree\"\n     * >AST</abbr>.\n     * @namespace\n     * @type {!Object.<string, function(...[*])>}\n     */\n    oWalkersPurifiers = {\n      /**#nocode+*/  // JsDoc Toolkit 2.4.0 hides some of the keys.\n      /**\n       * Deletes the scope information from the branch of the abstract\n       * syntax tree representing the encountered function declaration.\n       * @param {string} sIdentifier The identifier of the function.\n       * @param {!Array.<string>} aFormalParameterList Formal parameters.\n       * @param {!TSyntacticCodeUnit} oFunctionBody Function code.\n       */\n      'defun': function(\n          sIdentifier,\n          aFormalParameterList,\n          oFunctionBody) {\n        delete oFunctionBody.scope;\n      },\n      /**\n       * Deletes the scope information from the branch of the abstract\n       * syntax tree representing the encountered function expression.\n       * @param {?string} sIdentifier The optional identifier of the\n       *     function.\n       * @param {!Array.<string>} aFormalParameterList Formal parameters.\n       * @param {!TSyntacticCodeUnit} oFunctionBody Function code.\n       */\n      'function': function(\n          sIdentifier,\n          aFormalParameterList,\n          oFunctionBody) {\n        delete oFunctionBody.scope;\n      }\n      /**#nocode-*/  // JsDoc Toolkit 2.4.0 hides some of the keys.\n    },\n    /**\n     * Initiates the traversal of a source element.\n     * @param {!TWalker} oWalker An instance of an object that allows the\n     *     traversal of an abstract syntax tree.\n     * @param {!TSyntacticCodeUnit} oSourceElement A source element from\n     *     which the traversal should commence.\n     * @return {function(): !TSyntacticCodeUnit} A function that is able to\n     *     initiate the traversal from a given source element.\n     */\n    cContext = function(oWalker, oSourceElement) {\n      /**\n       * @return {!TSyntacticCodeUnit} A function that is able to\n       *     initiate the traversal from a given source element.\n       */\n      var fLambda = function() {\n        return oWalker.walk(oSourceElement);\n      };\n\n      return fLambda;\n    },\n    /**\n     * A record consisting of configuration for the code generation phase.\n     * @type {!Object}\n     */\n    oCodeGenerationOptions = {\n      beautify: true\n    },\n    /**\n     * A boolean to track whether all tests have passed.\n     * @type {boolean}\n     */\n    bTestsPassed = true,\n    /**\n     * Tests whether consolidation of an ECMAScript program yields expected\n     * results.\n     * @param {{\n     *       sTitle: string,\n     *       sInput: string,\n     *       sOutput: string\n     *     }} oUnitTest A record consisting of data about a unit test: its\n     *     name, an ECMAScript program, and, if consolidation is to take\n     *     place, the resulting ECMAScript program.\n     */\n    cAssert = function(oUnitTest) {\n      var _,\n          /**\n           * An array-like object representing the <abbr title=\n           * \"abstract syntax tree\">AST</abbr> obtained after consolidation.\n           * @type {!TSyntacticCodeUnit}\n           */\n          oSyntacticCodeUnitActual =\n              oConsolidator.ast_consolidate(oParser.parse(oUnitTest.sInput)),\n          /**\n           * An array-like object representing the expected <abbr title=\n           * \"abstract syntax tree\">AST</abbr>.\n           * @type {!TSyntacticCodeUnit}\n           */\n          oSyntacticCodeUnitExpected = oParser.parse(\n              oUnitTest.hasOwnProperty('sOutput') ?\n              oUnitTest.sOutput : oUnitTest.sInput);\n\n      delete oSyntacticCodeUnitActual.scope;\n      oWalker = oProcessor.ast_walker();\n      oWalker.with_walkers(\n          oWalkersPurifiers,\n          cContext(oWalker, oSyntacticCodeUnitActual));\n      try {\n        oAssert.deepEqual(\n            oSyntacticCodeUnitActual,\n            oSyntacticCodeUnitExpected);\n      } catch (oException) {\n        console.error(\n            '########## A unit test has failed.\\n' +\n            oUnitTest.sTitle + '\\n' +\n            '#####  actual code  (' +\n            oProcessor.gen_code(oSyntacticCodeUnitActual).length +\n            ' bytes)\\n' +\n            oProcessor.gen_code(\n                oSyntacticCodeUnitActual,\n                oCodeGenerationOptions) + '\\n' +\n            '##### expected code (' +\n            oProcessor.gen_code(oSyntacticCodeUnitExpected).length +\n            ' bytes)\\n' +\n            oProcessor.gen_code(\n                oSyntacticCodeUnitExpected,\n                oCodeGenerationOptions));\n        bTestsPassed = false;\n      }\n    };\n\n[\n  // 7.6.1 Reserved Words.\n  {\n    sTitle:\n        'Omission of keywords while choosing an identifier name.',\n    sInput:\n        '(function() {' +\n        '  var a, b, c, d, e, f, g, h, i, j, k, l, m,' +\n        '      n, o, p, q, r, s, t, u, v, w, x, y, z,' +\n        '      A, B, C, D, E, F, G, H, I, J, K, L, M,' +\n        '      N, O, P, Q, R, S, T, U, V, W, X, Y, Z,' +\n        '      $, _,' +\n        '      aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am,' +\n        '      an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az,' +\n        '      aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM,' +\n        '      aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ,' +\n        '      a$, a_,' +\n        '      ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm,' +\n        '      bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz,' +\n        '      bA, bB, bC, bD, bE, bF, bG, bH, bI, bJ, bK, bL, bM,' +\n        '      bN, bO, bP, bQ, bR, bS, bT, bU, bV, bW, bX, bY, bZ,' +\n        '      b$, b_,' +\n        '      ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, cl, cm,' +\n        '      cn, co, cp, cq, cr, cs, ct, cu, cv, cw, cx, cy, cz,' +\n        '      cA, cB, cC, cD, cE, cF, cG, cH, cI, cJ, cK, cL, cM,' +\n        '      cN, cO, cP, cQ, cR, cS, cT, cU, cV, cW, cX, cY, cZ,' +\n        '      c$, c_,' +\n        '      da, db, dc, dd, de, df, dg, dh, di, dj, dk, dl, dm,' +\n        '      dn, dq, dr, ds, dt, du, dv, dw, dx, dy, dz,' +\n        '      dA, dB, dC, dD, dE, dF, dG, dH, dI, dJ, dK, dL, dM,' +\n        '      dN, dO, dP, dQ, dR, dS, dT, dU, dV, dW, dX, dY, dZ,' +\n        '      d$, d_;' +\n        '  void [\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",' +\n        '        \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"];' +\n        '}());',\n    sOutput:\n        '(function() {' +\n        '  var eb =' +\n        '      \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",' +\n        '      a, b, c, d, e, f, g, h, i, j, k, l, m,' +\n        '      n, o, p, q, r, s, t, u, v, w, x, y, z,' +\n        '      A, B, C, D, E, F, G, H, I, J, K, L, M,' +\n        '      N, O, P, Q, R, S, T, U, V, W, X, Y, Z,' +\n        '      $, _,' +\n        '      aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am,' +\n        '      an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az,' +\n        '      aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM,' +\n        '      aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ,' +\n        '      a$, a_,' +\n        '      ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm,' +\n        '      bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz,' +\n        '      bA, bB, bC, bD, bE, bF, bG, bH, bI, bJ, bK, bL, bM,' +\n        '      bN, bO, bP, bQ, bR, bS, bT, bU, bV, bW, bX, bY, bZ,' +\n        '      b$, b_,' +\n        '      ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, cl, cm,' +\n        '      cn, co, cp, cq, cr, cs, ct, cu, cv, cw, cx, cy, cz,' +\n        '      cA, cB, cC, cD, cE, cF, cG, cH, cI, cJ, cK, cL, cM,' +\n        '      cN, cO, cP, cQ, cR, cS, cT, cU, cV, cW, cX, cY, cZ,' +\n        '      c$, c_,' +\n        '      da, db, dc, dd, de, df, dg, dh, di, dj, dk, dl, dm,' +\n        '      dn, dq, dr, ds, dt, du, dv, dw, dx, dy, dz,' +\n        '      dA, dB, dC, dD, dE, dF, dG, dH, dI, dJ, dK, dL, dM,' +\n        '      dN, dO, dP, dQ, dR, dS, dT, dU, dV, dW, dX, dY, dZ,' +\n        '      d$, d_;' +\n        '  void [eb, eb];' +\n        '}());'\n  },\n  // 7.8.1 Null Literals.\n  {\n    sTitle:\n        'Evaluation with regard to the null value.',\n    sInput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  var foo;' +\n        '  void [null, null, null];' +\n        '}());' +\n        'eval(\"\");' +\n        '(function() {' +\n        '  var foo;' +\n        '  void [null, null];' +\n        '}());',\n    sOutput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  var a = null, foo;' +\n        '  void [a, a, a];' +\n        '}());' +\n        'eval(\"\");' +\n        '(function() {' +\n        '  var foo;' +\n        '  void [null, null];' +\n        '}());'\n  },\n  // 7.8.2 Boolean Literals.\n  {\n    sTitle:\n        'Evaluation with regard to the false value.',\n    sInput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  var foo;' +\n        '  void [false, false, false];' +\n        '}());' +\n        'eval(\"\");' +\n        '(function() {' +\n        '  var foo;' +\n        '  void [false, false];' +\n        '}());',\n    sOutput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  var a = false, foo;' +\n        '  void [a, a, a];' +\n        '}());' +\n        'eval(\"\");' +\n        '(function() {' +\n        '  var foo;' +\n        '  void [false, false];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Evaluation with regard to the true value.',\n    sInput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  var foo;' +\n        '  void [true, true, true];' +\n        '}());' +\n        'eval(\"\");' +\n        '(function() {' +\n        '  var foo;' +\n        '  void [true, true];' +\n        '}());',\n    sOutput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  var a = true, foo;' +\n        '  void [a, a, a];' +\n        '}());' +\n        'eval(\"\");' +\n        '(function() {' +\n        '  var foo;' +\n        '  void [true, true];' +\n        '}());'\n  },\n  // 7.8.4 String Literals.\n  {\n    sTitle:\n        'Evaluation with regard to the String value of a string literal.',\n    sInput:\n        '(function() {' +\n        '  var foo;' +\n        '  void [\"abcd\", \"abcd\", \"abc\", \"abc\"];' +\n        '}());',\n    sOutput:\n        '(function() {' +\n        '  var a = \"abcd\", foo;' +\n        '  void [a, a, \"abc\", \"abc\"];' +\n        '}());'\n  },\n  // 7.8.5 Regular Expression Literals.\n  {\n    sTitle:\n        'Preservation of the pattern of a regular expression literal.',\n    sInput:\n        'void [/abcdefghijklmnopqrstuvwxyz/, /abcdefghijklmnopqrstuvwxyz/];'\n  },\n  {\n    sTitle:\n        'Preservation of the flags of a regular expression literal.',\n    sInput:\n        'void [/(?:)/gim, /(?:)/gim, /(?:)/gim, /(?:)/gim, /(?:)/gim,' +\n        '      /(?:)/gim, /(?:)/gim, /(?:)/gim, /(?:)/gim, /(?:)/gim,' +\n        '      /(?:)/gim, /(?:)/gim, /(?:)/gim, /(?:)/gim, /(?:)/gim];'\n  },\n  // 10.2 Lexical Environments.\n  {\n    sTitle:\n        'Preservation of identifier names in the same scope.',\n    sInput:\n        '/*jshint shadow:true */' +\n        'var a;' +\n        'function b(i) {' +\n        '}' +\n        'for (var c; 0 === Math.random(););' +\n        'for (var d in {});' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        'void [b(a), b(c), b(d)];' +\n        'void [typeof e];' +\n        'i: for (; 0 === Math.random();) {' +\n        '  if (42 === (new Date()).getMinutes()) {' +\n        '    continue i;' +\n        '  } else {' +\n        '    break i;' +\n        '  }' +\n        '}' +\n        'try {' +\n        '} catch (f) {' +\n        '} finally {' +\n        '}' +\n        '(function g(h) {' +\n        '}());' +\n        'void [{' +\n        '  i: 42,' +\n        '  \"j\": 42,' +\n        '  \\'k\\': 42' +\n        '}];' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];',\n    sOutput:\n        '/*jshint shadow:true */' +\n        'var a;' +\n        'function b(i) {' +\n        '}' +\n        'for (var c; 0 === Math.random(););' +\n        'for (var d in {});' +\n        '(function() {' +\n        '  var i = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [i];' +\n        '  void [b(a), b(c), b(d)];' +\n        '  void [typeof e];' +\n        '  i: for (; 0 === Math.random();) {' +\n        '    if (42 === (new Date()).getMinutes()) {' +\n        '      continue i;' +\n        '    } else {' +\n        '      break i;' +\n        '    }' +\n        '  }' +\n        '  try {' +\n        '  } catch (f) {' +\n        '  } finally {' +\n        '  }' +\n        '  (function g(h) {' +\n        '  }());' +\n        '  void [{' +\n        '    i: 42,' +\n        '    \"j\": 42,' +\n        '    \\'k\\': 42' +\n        '  }];' +\n        '  void [i];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Preservation of identifier names in nested function code.',\n    sInput:\n        '(function() {' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '  (function() {' +\n        '    var a;' +\n        '    for (var b; 0 === Math.random(););' +\n        '    for (var c in {});' +\n        '    void [typeof d];' +\n        '    h: for (; 0 === Math.random();) {' +\n        '      if (42 === (new Date()).getMinutes()) {' +\n        '        continue h;' +\n        '      } else {' +\n        '        break h;' +\n        '      }' +\n        '    }' +\n        '    try {' +\n        '    } catch (e) {' +\n        '    } finally {' +\n        '    }' +\n        '    (function f(g) {' +\n        '    }());' +\n        '    void [{' +\n        '      h: 42,' +\n        '      \"i\": 42,' +\n        '      \\'j\\': 42' +\n        '    }];' +\n        '  }());' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '}());',\n    sOutput:\n        '(function() {' +\n        '  var h = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [h];' +\n        '  (function() {' +\n        '    var a;' +\n        '    for (var b; 0 === Math.random(););' +\n        '    for (var c in {});' +\n        '    void [typeof d];' +\n        '    h: for (; 0 === Math.random();) {' +\n        '      if (42 === (new Date()).getMinutes()) {' +\n        '        continue h;' +\n        '      } else {' +\n        '        break h;' +\n        '      }' +\n        '    }' +\n        '    try {' +\n        '    } catch (e) {' +\n        '    } finally {' +\n        '    }' +\n        '    (function f(g) {' +\n        '    }());' +\n        '    void [{' +\n        '      h: 42,' +\n        '      \"i\": 42,' +\n        '      \\'j\\': 42' +\n        '    }];' +\n        '  }());' +\n        '  void [h];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Consolidation of a closure with other source elements.',\n    sInput:\n        '(function(foo) {' +\n        '}(\"abcdefghijklmnopqrstuvwxyz\"));' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];',\n    sOutput:\n        '(function() {' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  (function(foo) {' +\n        '  })(a);' +\n        '  void [a];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Consolidation of function code instead of a sole closure.',\n    sInput:\n        '(function(foo, bar) {' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '        \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '}(\"abcdefghijklmnopqrstuvwxyz\", \"abcdefghijklmnopqrstuvwxyz\"));',\n    sOutput:\n        '(function(foo, bar) {' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [a, a];' +\n        '}(\"abcdefghijklmnopqrstuvwxyz\", \"abcdefghijklmnopqrstuvwxyz\"));'\n  },\n  // 11.1.5 Object Initialiser.\n  {\n    sTitle:\n        'Preservation of property names of an object initialiser.',\n    sInput:\n        'var foo = {' +\n        '  abcdefghijklmnopqrstuvwxyz: 42,' +\n        '  \"zyxwvutsrqponmlkjihgfedcba\": 42,' +\n        '  \\'mlkjihgfedcbanopqrstuvwxyz\\': 42' +\n        '};' +\n        'void [' +\n        '  foo.abcdefghijklmnopqrstuvwxyz,' +\n        '  \"zyxwvutsrqponmlkjihgfedcba\",' +\n        '  \\'mlkjihgfedcbanopqrstuvwxyz\\'' +\n        '];'\n  },\n  {\n    sTitle:\n        'Evaluation with regard to String values derived from identifier ' +\n        'names used as property accessors.',\n    sInput:\n        '(function() {' +\n        '  var foo;' +\n        '  void [' +\n        '    Math.abcdefghij,' +\n        '    Math.abcdefghij,' +\n        '    Math.abcdefghi,' +\n        '    Math.abcdefghi' +\n        '  ];' +\n        '}());',\n    sOutput:\n        '(function() {' +\n        '  var a = \"abcdefghij\", foo;' +\n        '  void [' +\n        '    Math[a],' +\n        '    Math[a],' +\n        '    Math.abcdefghi,' +\n        '    Math.abcdefghi' +\n        '  ];' +\n        '}());'\n  },\n  // 11.2.1 Property Accessors.\n  {\n    sTitle:\n        'Preservation of identifiers in the nonterminal MemberExpression.',\n    sInput:\n        'void [' +\n        '  Math.E,' +\n        '  Math.LN10,' +\n        '  Math.LN2,' +\n        '  Math.LOG2E,' +\n        '  Math.LOG10E,' +\n        '  Math.PI,' +\n        '  Math.SQRT1_2,' +\n        '  Math.SQRT2,' +\n        '  Math.abs,' +\n        '  Math.acos' +\n        '];'\n  },\n  // 12.2 Variable Statement.\n  {\n    sTitle:\n        'Preservation of the identifier of a variable that is being ' +\n        'declared in a variable statement.',\n    sInput:\n        '(function() {' +\n        '  var abcdefghijklmnopqrstuvwxyz;' +\n        '  void [abcdefghijklmnopqrstuvwxyz];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Exclusion of a variable statement in global code.',\n    sInput:\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        'var foo = \"abcdefghijklmnopqrstuvwxyz\",' +\n        '    bar = \"abcdefghijklmnopqrstuvwxyz\";' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];'\n  },\n  {\n    sTitle:\n        'Exclusion of a variable statement in function code that ' +\n        'contains a with statement.',\n    sInput:\n        '(function() {' +\n        '  with ({});' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '  var foo;' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Exclusion of a variable statement in function code that ' +\n        'contains a direct call to the eval function.',\n    sInput:\n        '/*jshint evil:true */' +\n        'void [' +\n        '  function() {' +\n        '    eval(\"\");' +\n        '    void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '    var foo;' +\n        '    void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '  }' +\n        '];'\n  },\n  {\n    sTitle:\n        'Consolidation within a variable statement in global code.',\n    sInput:\n        'var foo = function() {' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '        \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '};',\n    sOutput:\n        'var foo = function() {' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [a, a];' +\n        '};'\n  },\n  {\n    sTitle:\n        'Consolidation within a variable statement excluded in function ' +\n        'code due to the presence of a with statement.',\n    sInput:\n        '(function() {' +\n        '  with ({});' +\n        '  var foo = function() {' +\n        '    void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '          \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '  };' +\n        '}());',\n    sOutput:\n        '(function() {' +\n        '  with ({});' +\n        '  var foo = function() {' +\n        '    var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '    void [a, a];' +\n        '  };' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Consolidation within a variable statement excluded in function ' +\n        'code due to the presence of a direct call to the eval function.',\n    sInput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  eval(\"\");' +\n        '  var foo = function() {' +\n        '    void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '          \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '  };' +\n        '}());',\n    sOutput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  eval(\"\");' +\n        '  var foo = function() {' +\n        '    var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '    void [a, a];' +\n        '  };' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Inclusion of a variable statement in function code that ' +\n        'contains no with statement and no direct call to the eval ' +\n        'function.',\n    sInput:\n        '(function() {' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '  var foo;' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '}());',\n    sOutput:\n        '(function() {' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [a];' +\n        '  var foo;' +\n        '  void [a];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Ignorance with regard to a variable statement in global code.',\n    sInput:\n        'var foo = \"abcdefghijklmnopqrstuvwxyz\";' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '      \"abcdefghijklmnopqrstuvwxyz\"];',\n    sOutput:\n        'var foo = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '(function() {' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [a, a];' +\n        '}());'\n  },\n  // 12.4 Expression Statement.\n  {\n    sTitle:\n        'Preservation of identifiers in an expression statement.',\n    sInput:\n        'void [typeof abcdefghijklmnopqrstuvwxyz,' +\n        '      typeof abcdefghijklmnopqrstuvwxyz];'\n  },\n  // 12.6.3 The {@code for} Statement.\n  {\n    sTitle:\n        'Preservation of identifiers in the variable declaration list of ' +\n        'a for statement.',\n    sInput:\n        'for (var abcdefghijklmnopqrstuvwxyz; 0 === Math.random(););' +\n        'for (var abcdefghijklmnopqrstuvwxyz; 0 === Math.random(););'\n  },\n  // 12.6.4 The {@code for-in} Statement.\n  {\n    sTitle:\n        'Preservation of identifiers in the variable declaration list of ' +\n        'a for-in statement.',\n    sInput:\n        'for (var abcdefghijklmnopqrstuvwxyz in {});' +\n        'for (var abcdefghijklmnopqrstuvwxyz in {});'\n  },\n  // 12.7 The {@code continue} Statement.\n  {\n    sTitle:\n        'Preservation of the identifier in a continue statement.',\n    sInput:\n        'abcdefghijklmnopqrstuvwxyz: for (; 0 === Math.random();) {' +\n        '  continue abcdefghijklmnopqrstuvwxyz;' +\n        '}' +\n        'abcdefghijklmnopqrstuvwxyz: for (; 0 === Math.random();) {' +\n        '  continue abcdefghijklmnopqrstuvwxyz;' +\n        '}'\n  },\n  // 12.8 The {@code break} Statement.\n  {\n    sTitle:\n        'Preservation of the identifier in a break statement.',\n    sInput:\n        'abcdefghijklmnopqrstuvwxyz: for (; 0 === Math.random();) {' +\n        '  break abcdefghijklmnopqrstuvwxyz;' +\n        '}' +\n        'abcdefghijklmnopqrstuvwxyz: for (; 0 === Math.random();) {' +\n        '  break abcdefghijklmnopqrstuvwxyz;' +\n        '}'\n  },\n  // 12.9 The {@code return} Statement.\n  {\n    sTitle:\n        'Exclusion of a return statement in function code that contains ' +\n        'a with statement.',\n    sInput:\n        '(function() {' +\n        '  with ({});' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '  if (0 === Math.random()) {' +\n        '    return;' +\n        '  } else {' +\n        '  }' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Exclusion of a return statement in function code that contains ' +\n        'a direct call to the eval function.',\n    sInput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  eval(\"\");' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '  if (0 === Math.random()) {' +\n        '    return;' +\n        '  } else {' +\n        '  }' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Consolidation within a return statement excluded in function ' +\n        'code due to the presence of a with statement.',\n    sInput:\n        '(function() {' +\n        '  with ({});' +\n        '  return function() {' +\n        '    void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '          \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '  };' +\n        '}());',\n    sOutput:\n        '(function() {' +\n        '  with ({});' +\n        '  return function() {' +\n        '    var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '    void [a, a];' +\n        '  };' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Consolidation within a return statement excluded in function ' +\n        'code due to the presence of a direct call to the eval function.',\n    sInput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  eval(\"\");' +\n        '  return function() {' +\n        '    void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '          \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '  };' +\n        '}());',\n    sOutput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  eval(\"\");' +\n        '  return function() {' +\n        '    var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '    void [a, a];' +\n        '  };' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Inclusion of a return statement in function code that contains ' +\n        'no with statement and no direct call to the eval function.',\n    sInput:\n        '(function() {' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '  if (0 === Math.random()) {' +\n        '    return;' +\n        '  } else {' +\n        '  }' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '}());',\n    sOutput:\n        '(function() {' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [a];' +\n        '  if (0 === Math.random()) {' +\n        '    return;' +\n        '  } else {' +\n        '  }' +\n        '  void [a];' +\n        '}());'\n  },\n  // 12.10 The {@code with} Statement.\n  {\n    sTitle:\n        'Preservation of the statement in a with statement.',\n    sInput:\n        'with ({}) {' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '        \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '}'\n  },\n  {\n    sTitle:\n        'Exclusion of a with statement in the same syntactic code unit.',\n    sInput:\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        'with ({' +\n        '  foo: \"abcdefghijklmnopqrstuvwxyz\",' +\n        '  bar: \"abcdefghijklmnopqrstuvwxyz\"' +\n        '}) {' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '        \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '}' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];'\n  },\n  {\n    sTitle:\n        'Exclusion of a with statement in nested function code.',\n    sInput:\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '(function() {' +\n        '  with ({' +\n        '    foo: \"abcdefghijklmnopqrstuvwxyz\",' +\n        '    bar: \"abcdefghijklmnopqrstuvwxyz\"' +\n        '  }) {' +\n        '    void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '          \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '  }' +\n        '}());' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];'\n  },\n  // 12.12 Labelled Statements.\n  {\n    sTitle:\n        'Preservation of the label of a labelled statement.',\n    sInput:\n        'abcdefghijklmnopqrstuvwxyz: for (; 0 === Math.random(););' +\n        'abcdefghijklmnopqrstuvwxyz: for (; 0 === Math.random(););'\n  },\n  // 12.14 The {@code try} Statement.\n  {\n    sTitle:\n        'Preservation of the identifier in the catch clause of a try' +\n        'statement.',\n    sInput:\n        'try {' +\n        '} catch (abcdefghijklmnopqrstuvwxyz) {' +\n        '} finally {' +\n        '}' +\n        'try {' +\n        '} catch (abcdefghijklmnopqrstuvwxyz) {' +\n        '} finally {' +\n        '}'\n  },\n  // 13 Function Definition.\n  {\n    sTitle:\n        'Preservation of the identifier of a function declaration.',\n    sInput:\n        'function abcdefghijklmnopqrstuvwxyz() {' +\n        '}' +\n        'void [abcdefghijklmnopqrstuvwxyz];'\n  },\n  {\n    sTitle:\n        'Preservation of the identifier of a function expression.',\n    sInput:\n        'void [' +\n        '  function abcdefghijklmnopqrstuvwxyz() {' +\n        '  },' +\n        '  function abcdefghijklmnopqrstuvwxyz() {' +\n        '  }' +\n        '];'\n  },\n  {\n    sTitle:\n        'Preservation of a formal parameter of a function declaration.',\n    sInput:\n        'function foo(abcdefghijklmnopqrstuvwxyz) {' +\n        '}' +\n        'function bar(abcdefghijklmnopqrstuvwxyz) {' +\n        '}'\n  },\n  {\n    sTitle:\n        'Preservation of a formal parameter in a function expression.',\n    sInput:\n        'void [' +\n        '  function(abcdefghijklmnopqrstuvwxyz) {' +\n        '  },' +\n        '  function(abcdefghijklmnopqrstuvwxyz) {' +\n        '  }' +\n        '];'\n  },\n  {\n    sTitle:\n        'Exclusion of a function declaration.',\n    sInput:\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        'function foo() {' +\n        '}' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];'\n  },\n  {\n    sTitle:\n        'Consolidation within a function declaration.',\n    sInput:\n        'function foo() {' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '        \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '}',\n    sOutput:\n        'function foo() {' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [a, a];' +\n        '}'\n  },\n  // 14 Program.\n  {\n    sTitle:\n        'Preservation of a program without source elements.',\n    sInput:\n        ''\n  },\n  // 14.1 Directive Prologues and the Use Strict Directive.\n  {\n    sTitle:\n        'Preservation of a Directive Prologue in global code.',\n    sInput:\n        '\"abcdefghijklmnopqrstuvwxyz\";' +\n        '\\'zyxwvutsrqponmlkjihgfedcba\\';'\n  },\n  {\n    sTitle:\n        'Preservation of a Directive Prologue in a function declaration.',\n    sInput:\n        'function foo() {' +\n        '  \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  \\'zyxwvutsrqponmlkjihgfedcba\\';' +\n        '}'\n  },\n  {\n    sTitle:\n        'Preservation of a Directive Prologue in a function expression.',\n    sInput:\n        'void [' +\n        '  function() {' +\n        '    \"abcdefghijklmnopqrstuvwxyz\";' +\n        '    \\'zyxwvutsrqponmlkjihgfedcba\\';' +\n        '  }' +\n        '];'\n  },\n  {\n    sTitle:\n        'Ignorance with regard to a Directive Prologue in global code.',\n    sInput:\n        '\"abcdefghijklmnopqrstuvwxyz\";' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '      \"abcdefghijklmnopqrstuvwxyz\"];',\n    sOutput:\n        '\"abcdefghijklmnopqrstuvwxyz\";' +\n        '(function() {' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [a, a];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Ignorance with regard to a Directive Prologue in a function' +\n        'declaration.',\n    sInput:\n        'function foo() {' +\n        '  \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '        \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '}',\n    sOutput:\n        'function foo() {' +\n        '  \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [a, a];' +\n        '}'\n  },\n  {\n    sTitle:\n        'Ignorance with regard to a Directive Prologue in a function' +\n        'expression.',\n    sInput:\n        '(function() {' +\n        '  \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '        \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '}());',\n    sOutput:\n        '(function() {' +\n        '  \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [a, a];' +\n        '}());'\n  },\n  // 15.1 The Global Object.\n  {\n    sTitle:\n        'Preservation of a property of the global object.',\n    sInput:\n        'void [undefined, undefined, undefined, undefined, undefined];'\n  },\n  // 15.1.2.1.1 Direct Call to Eval.\n  {\n    sTitle:\n        'Exclusion of a direct call to the eval function in the same ' +\n        'syntactic code unit.',\n    sInput:\n        '/*jshint evil:true */' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        'eval(\"\");' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];'\n  },\n  {\n    sTitle:\n        'Exclusion of a direct call to the eval function in nested ' +\n        'function code.',\n    sInput:\n        '/*jshint evil:true */' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];' +\n        '(function() {' +\n        '  eval(\"\");' +\n        '}());' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\"];'\n  },\n  {\n    sTitle:\n        'Consolidation within a direct call to the eval function.',\n    sInput:\n        '/*jshint evil:true */' +\n        'eval(function() {' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '        \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '}());',\n    sOutput:\n        '/*jshint evil:true */' +\n        'eval(function() {' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [a, a];' +\n        '}());'\n  },\n  // Consolidation proper.\n  {\n    sTitle:\n        'No consolidation if it does not result in a reduction of the ' +\n        'number of source characters.',\n    sInput:\n        '(function() {' +\n        '  var foo;' +\n        '  void [\"ab\", \"ab\", \"abc\", \"abc\"];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Identification of a range of source elements at the beginning ' +\n        'of global code.',\n    sInput:\n        '/*jshint evil:true */' +\n        '\"abcdefghijklmnopqrstuvwxyz\";' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '      \"abcdefghijklmnopqrstuvwxyz\"];' +\n        'eval(\"\");',\n    sOutput:\n        '/*jshint evil:true */' +\n        '\"abcdefghijklmnopqrstuvwxyz\";' +\n        '(function() {' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [a, a];' +\n        '}());' +\n        'eval(\"\");'\n  },\n  {\n    sTitle:\n        'Identification of a range of source elements in the middle of ' +\n        'global code.',\n    sInput:\n        '/*jshint evil:true */' +\n        '\"abcdefghijklmnopqrstuvwxyz\";' +\n        'eval(\"\");' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '      \"abcdefghijklmnopqrstuvwxyz\"];' +\n        'eval(\"\");',\n    sOutput:\n        '/*jshint evil:true */' +\n        '\"abcdefghijklmnopqrstuvwxyz\";' +\n        'eval(\"\");' +\n        '(function() {' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [a, a];' +\n        '}());' +\n        'eval(\"\");'\n  },\n  {\n    sTitle:\n        'Identification of a range of source elements at the end of ' +\n        'global code.',\n    sInput:\n        '/*jshint evil:true */' +\n        '\"abcdefghijklmnopqrstuvwxyz\";' +\n        'eval(\"\");' +\n        'void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '      \"abcdefghijklmnopqrstuvwxyz\"];',\n    sOutput:\n        '/*jshint evil:true */' +\n        '\"abcdefghijklmnopqrstuvwxyz\";' +\n        'eval(\"\");' +\n        '(function() {' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [a, a];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Identification of a range of source elements at the beginning ' +\n        'of function code.',\n    sInput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '        \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '  eval(\"\");' +\n        '}());',\n    sOutput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  (function() {' +\n        '    var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '    void [a, a];' +\n        '  }());' +\n        '  eval(\"\");' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Identification of a range of source elements in the middle of ' +\n        'function code.',\n    sInput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  eval(\"\");' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '        \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '  eval(\"\");' +\n        '}());',\n    sOutput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  eval(\"\");' +\n        '  (function() {' +\n        '    var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '    void [a, a];' +\n        '  }());' +\n        '  eval(\"\");' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Identification of a range of source elements at the end of ' +\n        'function code.',\n    sInput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  eval(\"\");' +\n        '  void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '        \"abcdefghijklmnopqrstuvwxyz\"];' +\n        '}());',\n    sOutput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  eval(\"\");' +\n        '  (function() {' +\n        '    var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '    void [a, a];' +\n        '  }());' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Evaluation with regard to String values of String literals and ' +\n        'String values derived from identifier names used as property' +\n        'accessors.',\n    sInput:\n        '(function() {' +\n        '  var foo;' +\n        '  void [\"abcdefg\", Math.abcdefg, \"abcdef\", Math.abcdef];' +\n        '}());',\n    sOutput:\n        '(function() {' +\n        '  var a = \"abcdefg\", foo;' +\n        '  void [a, Math[a], \"abcdef\", Math.abcdef];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Evaluation with regard to the necessity of adding a variable ' +\n        'statement.',\n    sInput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  void [\"abcdefgh\", \"abcdefgh\"];' +\n        '}());' +\n        'eval(\"\");' +\n        '(function() {' +\n        '  void [\"abcdefg\", \"abcdefg\"];' +\n        '}());' +\n        'eval(\"\");' +\n        '(function() {' +\n        '  var foo;' +\n        '  void [\"abcd\", \"abcd\"];' +\n        '}());',\n    sOutput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  var a = \"abcdefgh\";' +\n        '  void [a, a];' +\n        '}());' +\n        'eval(\"\");' +\n        '(function() {' +\n        '  void [\"abcdefg\", \"abcdefg\"];' +\n        '}());' +\n        'eval(\"\");' +\n        '(function() {' +\n        '  var a = \"abcd\", foo;' +\n        '  void [a, a];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Evaluation with regard to the necessity of enclosing source ' +\n        'elements.',\n    sInput:\n        '/*jshint evil:true */' +\n        'void [\"abcdefghijklmnopqrstuvwxy\", \"abcdefghijklmnopqrstuvwxy\"];' +\n        'eval(\"\");' +\n        'void [\"abcdefghijklmnopqrstuvwx\", \"abcdefghijklmnopqrstuvwx\"];' +\n        'eval(\"\");' +\n        '(function() {' +\n        '  void [\"abcdefgh\", \"abcdefgh\"];' +\n        '}());' +\n        '(function() {' +\n        '  void [\"abcdefghijklmnopqrstuvwxy\",' +\n        '        \"abcdefghijklmnopqrstuvwxy\"];' +\n        '  eval(\"\");' +\n        '  void [\"abcdefghijklmnopqrstuvwx\",' +\n        '        \"abcdefghijklmnopqrstuvwx\"];' +\n        '  eval(\"\");' +\n        '  (function() {' +\n        '    void [\"abcdefgh\", \"abcdefgh\"];' +\n        '  }());' +\n        '}());',\n    sOutput:\n        '/*jshint evil:true */' +\n        '(function() {' +\n        '  var a = \"abcdefghijklmnopqrstuvwxy\";' +\n        '  void [a, a];' +\n        '}());' +\n        'eval(\"\");' +\n        'void [\"abcdefghijklmnopqrstuvwx\", \"abcdefghijklmnopqrstuvwx\"];' +\n        'eval(\"\");' +\n        '(function() {' +\n        '  var a = \"abcdefgh\";' +\n        '  void [a, a];' +\n        '}());' +\n        '(function() {' +\n        '  (function() {' +\n        '    var a = \"abcdefghijklmnopqrstuvwxy\";' +\n        '    void [a, a];' +\n        '  }());' +\n        '  eval(\"\");' +\n        '  void [\"abcdefghijklmnopqrstuvwx\", \"abcdefghijklmnopqrstuvwx\"];' +\n        '  eval(\"\");' +\n        '  (function() {' +\n        '    var a = \"abcdefgh\";' +\n        '    void [a, a];' +\n        '  }());' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Employment of a closure while consolidating in global code.',\n    sInput:\n        'void [\"abcdefghijklmnopqrstuvwxyz\",' +\n        '      \"abcdefghijklmnopqrstuvwxyz\"];',\n    sOutput:\n        '(function() {' +\n        '  var a = \"abcdefghijklmnopqrstuvwxyz\";' +\n        '  void [a, a];' +\n        '}());'\n  },\n  {\n    sTitle:\n        'Assignment of a shorter identifier to a value whose ' +\n        'consolidation results in a greater reduction of the number of ' +\n        'source characters.',\n    sInput:\n        '(function() {' +\n        '  var b, c, d, e, f, g, h, i, j, k, l, m,' +\n        '      n, o, p, q, r, s, t, u, v, w, x, y, z,' +\n        '      A, B, C, D, E, F, G, H, I, J, K, L, M,' +\n        '      N, O, P, Q, R, S, T, U, V, W, X, Y, Z,' +\n        '      $, _;' +\n        '  void [\"abcde\", \"abcde\", \"edcba\", \"edcba\", \"edcba\"];' +\n        '}());',\n    sOutput:\n        '(function() {' +\n        '  var a = \"edcba\",' +\n        '      b, c, d, e, f, g, h, i, j, k, l, m,' +\n        '      n, o, p, q, r, s, t, u, v, w, x, y, z,' +\n        '      A, B, C, D, E, F, G, H, I, J, K, L, M,' +\n        '      N, O, P, Q, R, S, T, U, V, W, X, Y, Z,' +\n        '      $, _;' +\n        '  void [\"abcde\", \"abcde\", a, a, a];' +\n        '}());'\n  }\n].forEach(cAssert);\n\nprocess.exit(bTestsPassed ? 0 : 1);\n\n"
  },
  {
    "path": "test/testparser.js",
    "content": "#! /usr/bin/env node\nglobal.DIGITS_OVERRIDE_FOR_TESTING = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789\";\n\nvar parseJS = require(\"../lib/parse-js\");\nvar sys = require(\"util\");\n\n// write debug in a very straightforward manner\nvar debug = function(){\n        sys.log(Array.prototype.slice.call(arguments).join(', '));\n};\n\nvar testsPassed = true;\n\nParserTestSuite(function(i, input, desc){\n\ttry {\n\t\tparseJS.parse(input);\n\t\tdebug(\"ok \" + i + \": \" + desc);\n\t} catch(e){\n\t\tdebug(\"FAIL \" + i + \" \" + desc + \" (\" + e + \")\");\n    testsPassed = false;\n\t}\n});\n\nprocess.exit(testsPassed ? 0 : 1);\n\nfunction ParserTestSuite(callback){\n\tvar inps = [\n\t\t[\"var abc;\", \"Regular variable statement w/o assignment\"],\n\t\t[\"var abc = 5;\", \"Regular variable statement with assignment\"],\n\t\t[\"/* */;\", \"Multiline comment\"],\n\t\t['/** **/;', 'Double star multiline comment'],\n\t\t[\"var f = function(){;};\", \"Function expression in var assignment\"],\n\t\t['hi; // moo\\n;', 'single line comment'],\n\t\t['var varwithfunction;', 'Dont match keywords as substrings'], // difference between `var withsomevar` and `\"str\"` (local search and lits)\n\t\t['a + b;', 'addition'],\n\t\t[\"'a';\", 'single string literal'],\n\t\t[\"'a\\\\n';\", 'single string literal with escaped return'],\n\t\t['\"a\";', 'double string literal'],\n\t\t['\"a\\\\n\";', 'double string literal with escaped return'],\n\t\t['\"var\";', 'string is a keyword'],\n\t\t['\"variable\";', 'string starts with a keyword'],\n\t\t['\"somevariable\";', 'string contains a keyword'],\n\t\t['\"somevar\";', 'string ends with a keyword'],\n\t\t['500;', 'int literal'],\n\t\t['500.;', 'float literal w/o decimals'],\n\t\t['500.432;', 'float literal with decimals'],\n\t\t['.432432;', 'float literal w/o int'],\n\t\t['(a,b,c);', 'parens and comma'],\n\t\t['[1,2,abc];', 'array literal'],\n\t\t['var o = {a:1};', 'object literal unquoted key'],\n\t\t['var o = {\"b\":2};', 'object literal quoted key'], // opening curly may not be at the start of a statement...\n\t\t['var o = {c:c};', 'object literal keyname is identifier'],\n\t\t['var o = {a:1,\"b\":2,c:c};', 'object literal combinations'],\n\t\t['var x;\\nvar y;', 'two lines'],\n\t\t['var x;\\nfunction n(){; }', 'function def'],\n\t\t['var x;\\nfunction n(abc){; }', 'function def with arg'],\n\t\t['var x;\\nfunction n(abc, def){ ;}', 'function def with args'],\n\t\t['function n(){ \"hello\"; }', 'function def with body'],\n\t\t['/a/;', 'regex literal'],\n\t\t['/a/b;', 'regex literal with flag'],\n\t\t['/a/ / /b/;', 'regex div regex'],\n\t\t['a/b/c;', 'triple division looks like regex'],\n\t\t['+function(){/regex/;};', 'regex at start of function body'],\n\t\t// http://code.google.com/p/es-lab/source/browse/trunk/tests/parser/parsertests.js?r=86\n\t\t// http://code.google.com/p/es-lab/source/browse/trunk/tests/parser/parsertests.js?r=430\n\n\t\t// first tests for the lexer, should also parse as program (when you append a semi)\n\n\t\t// comments\n\t\t['//foo!@#^&$1234\\nbar;', 'single line comment'],\n\t\t['/* abcd!@#@$* { } && null*/;', 'single line multi line comment'],\n\t\t['/*foo\\nbar*/;','multi line comment'],\n\t\t['/*x*x*/;','multi line comment with *'],\n\t\t['/**/;','empty comment'],\n\t\t// identifiers\n\t\t[\"x;\",'1 identifier'],\n\t\t[\"_x;\",'2 identifier'],\n\t\t[\"xyz;\",'3 identifier'],\n\t\t[\"$x;\",'4 identifier'],\n\t\t[\"x$;\",'5 identifier'],\n\t\t[\"_;\",'6 identifier'],\n\t\t[\"x5;\",'7 identifier'],\n\t\t[\"x_y;\",'8 identifier'],\n\t\t[\"x+5;\",'9 identifier'],\n\t\t[\"xyz123;\",'10 identifier'],\n\t\t[\"x1y1z1;\",'11 identifier'],\n\t\t[\"foo\\\\u00D8bar;\",'12 identifier unicode escape'],\n\t\t//[\"foo�bar;\",'13 identifier unicode embedded (might fail)'],\n\t\t// numbers\n\t\t[\"5;\", '1 number'],\n\t\t[\"5.5;\", '2 number'],\n\t\t[\"0;\", '3 number'],\n\t\t[\"0.0;\", '4 number'],\n\t\t[\"0.001;\", '5 number'],\n\t\t[\"1.e2;\", '6 number'],\n\t\t[\"1.e-2;\", '7 number'],\n\t\t[\"1.E2;\", '8 number'],\n\t\t[\"1.E-2;\", '9 number'],\n\t\t[\".5;\", '10 number'],\n\t\t[\".5e3;\", '11 number'],\n\t\t[\".5e-3;\", '12 number'],\n\t\t[\"0.5e3;\", '13 number'],\n\t\t[\"55;\", '14 number'],\n\t\t[\"123;\", '15 number'],\n\t\t[\"55.55;\", '16 number'],\n\t\t[\"55.55e10;\", '17 number'],\n\t\t[\"123.456;\", '18 number'],\n\t\t[\"1+e;\", '20 number'],\n\t\t[\"0x01;\", '22 number'],\n\t\t[\"0XCAFE;\", '23 number'],\n\t\t[\"0x12345678;\", '24 number'],\n\t\t[\"0x1234ABCD;\", '25 number'],\n\t\t[\"0x0001;\", '26 number'],\n\t\t// strings\n\t\t[\"\\\"foo\\\";\", '1 string'],\n\t\t[\"\\'foo\\';\", '2 string'],\n\t\t[\"\\\"x\\\";\", '3 string'],\n\t\t[\"\\'\\';\", '4 string'],\n\t\t[\"\\\"foo\\\\tbar\\\";\", '5 string'],\n\t\t[\"\\\"!@#$%^&*()_+{}[]\\\";\", '6 string'],\n\t\t[\"\\\"/*test*/\\\";\", '7 string'],\n\t\t[\"\\\"//test\\\";\", '8 string'],\n\t\t[\"\\\"\\\\\\\\\\\";\", '9 string'],\n\t\t[\"\\\"\\\\u0001\\\";\", '10 string'],\n\t\t[\"\\\"\\\\uFEFF\\\";\", '11 string'],\n\t\t[\"\\\"\\\\u10002\\\";\", '12 string'],\n\t\t[\"\\\"\\\\x55\\\";\", '13 string'],\n\t\t[\"\\\"\\\\x55a\\\";\", '14 string'],\n\t\t[\"\\\"a\\\\\\\\nb\\\";\", '15 string'],\n\t\t['\";\"', '16 string: semi in a string'],\n\t\t['\"a\\\\\\nb\";', '17 string: line terminator escape'],\n\t\t// literals\n\t\t[\"null;\", \"null\"],\n\t\t[\"true;\", \"true\"],\n\t\t[\"false;\", \"false\"],\n\t\t// regex\n\t\t[\"/a/;\", \"1 regex\"],\n\t\t[\"/abc/;\", \"2 regex\"],\n\t\t[\"/abc[a-z]*def/g;\", \"3 regex\"],\n\t\t[\"/\\\\b/;\", \"4 regex\"],\n\t\t[\"/[a-zA-Z]/;\", \"5 regex\"],\n\n\t\t// program tests (for as far as they havent been covered above)\n\n\t\t// regexp\n\t\t[\"/foo(.*)/g;\", \"another regexp\"],\n\t\t// arrays\n\t\t[\"[];\", \"1 array\"],\n\t\t[\"[   ];\", \"2 array\"],\n\t\t[\"[1];\", \"3 array\"],\n\t\t[\"[1,2];\", \"4 array\"],\n\t\t[\"[1,2,,];\", \"5 array\"],\n\t\t[\"[1,2,3];\", \"6 array\"],\n\t\t[\"[1,2,3,,,];\", \"7 array\"],\n\t\t// objects\n\t\t[\"{};\", \"1 object\"],\n\t\t[\"({x:5});\", \"2 object\"],\n\t\t[\"({x:5,y:6});\", \"3 object\"],\n\t\t[\"({x:5,});\", \"4 object\"],\n\t\t[\"({if:5});\", \"5 object\"],\n\t\t[\"({ get x() {42;} });\", \"6 object\"],\n\t\t[\"({ set y(a) {1;} });\", \"7 object\"],\n\t\t// member expression\n\t\t[\"o.m;\", \"1 member expression\"],\n\t\t[\"o['m'];\", \"2 member expression\"],\n\t\t[\"o['n']['m'];\", \"3 member expression\"],\n\t\t[\"o.n.m;\", \"4 member expression\"],\n\t\t[\"o.if;\", \"5 member expression\"],\n\t\t// call and invoke expressions\n\t\t[\"f();\", \"1 call/invoke expression\"],\n\t\t[\"f(x);\", \"2 call/invoke expression\"],\n\t\t[\"f(x,y);\", \"3 call/invoke expression\"],\n\t\t[\"o.m();\", \"4 call/invoke expression\"],\n\t\t[\"o['m'];\", \"5 call/invoke expression\"],\n\t\t[\"o.m(x);\", \"6 call/invoke expression\"],\n\t\t[\"o['m'](x);\", \"7 call/invoke expression\"],\n\t\t[\"o.m(x,y);\", \"8 call/invoke expression\"],\n\t\t[\"o['m'](x,y);\", \"9 call/invoke expression\"],\n\t\t[\"f(x)(y);\", \"10 call/invoke expression\"],\n\t\t[\"f().x;\", \"11 call/invoke expression\"],\n\n\t\t// eval\n\t\t[\"eval('x');\", \"1 eval\"],\n\t\t[\"(eval)('x');\", \"2 eval\"],\n\t\t[\"(1,eval)('x');\", \"3 eval\"],\n\t\t[\"eval(x,y);\", \"4 eval\"],\n\t\t// new expression\n\t\t[\"new f();\", \"1 new expression\"],\n\t\t[\"new o;\", \"2 new expression\"],\n\t\t[\"new o.m;\", \"3 new expression\"],\n\t\t[\"new o.m(x);\", \"4 new expression\"],\n\t\t[\"new o.m(x,y);\", \"5 new expression\"],\n\t\t// prefix/postfix\n\t\t[\"++x;\", \"1 pre/postfix\"],\n\t\t[\"x++;\", \"2 pre/postfix\"],\n\t\t[\"--x;\", \"3 pre/postfix\"],\n\t\t[\"x--;\", \"4 pre/postfix\"],\n\t\t[\"x ++;\", \"5 pre/postfix\"],\n\t\t[\"x /* comment */ ++;\", \"6 pre/postfix\"],\n\t\t[\"++ /* comment */ x;\", \"7 pre/postfix\"],\n\t\t// unary operators\n\t\t[\"delete x;\", \"1 unary operator\"],\n\t\t[\"void x;\", \"2 unary operator\"],\n\t\t[\"+ x;\", \"3 unary operator\"],\n\t\t[\"-x;\", \"4 unary operator\"],\n\t\t[\"~x;\", \"5 unary operator\"],\n\t\t[\"!x;\", \"6 unary operator\"],\n\t\t// meh\n\t\t[\"new Date++;\", \"new date ++\"],\n\t\t[\"+x++;\", \" + x ++\"],\n\t\t// expression expressions\n\t\t[\"1 * 2;\", \"1 expression expressions\"],\n\t\t[\"1 / 2;\", \"2 expression expressions\"],\n\t\t[\"1 % 2;\", \"3 expression expressions\"],\n\t\t[\"1 + 2;\", \"4 expression expressions\"],\n\t\t[\"1 - 2;\", \"5 expression expressions\"],\n\t\t[\"1 << 2;\", \"6 expression expressions\"],\n\t\t[\"1 >>> 2;\", \"7 expression expressions\"],\n\t\t[\"1 >> 2;\", \"8 expression expressions\"],\n\t\t[\"1 * 2 + 3;\", \"9 expression expressions\"],\n\t\t[\"(1+2)*3;\", \"10 expression expressions\"],\n\t\t[\"1*(2+3);\", \"11 expression expressions\"],\n\t\t[\"x<y;\", \"12 expression expressions\"],\n\t\t[\"x>y;\", \"13 expression expressions\"],\n\t\t[\"x<=y;\", \"14 expression expressions\"],\n\t\t[\"x>=y;\", \"15 expression expressions\"],\n\t\t[\"x instanceof y;\", \"16 expression expressions\"],\n\t\t[\"x in y;\", \"17 expression expressions\"],\n\t\t[\"x&y;\", \"18 expression expressions\"],\n\t\t[\"x^y;\", \"19 expression expressions\"],\n\t\t[\"x|y;\", \"20 expression expressions\"],\n\t\t[\"x+y<z;\", \"21 expression expressions\"],\n\t\t[\"x<y+z;\", \"22 expression expressions\"],\n\t\t[\"x+y+z;\", \"23 expression expressions\"],\n\t\t[\"x+y<z;\", \"24 expression expressions\"],\n\t\t[\"x<y+z;\", \"25 expression expressions\"],\n\t\t[\"x&y|z;\", \"26 expression expressions\"],\n\t\t[\"x&&y;\", \"27 expression expressions\"],\n\t\t[\"x||y;\", \"28 expression expressions\"],\n\t\t[\"x&&y||z;\", \"29 expression expressions\"],\n\t\t[\"x||y&&z;\", \"30 expression expressions\"],\n\t\t[\"x<y?z:w;\", \"31 expression expressions\"],\n\t\t// assignment\n\t\t[\"x >>>= y;\", \"1 assignment\"],\n\t\t[\"x <<= y;\", \"2 assignment\"],\n\t\t[\"x = y;\", \"3 assignment\"],\n\t\t[\"x += y;\", \"4 assignment\"],\n\t\t[\"x /= y;\", \"5 assignment\"],\n\t\t// comma\n\t\t[\"x, y;\", \"comma\"],\n\t\t// block\n\t\t[\"{};\", \"1 block\"],\n\t\t[\"{x;};\", \"2 block\"],\n\t\t[\"{x;y;};\", \"3 block\"],\n\t\t// vars\n\t\t[\"var x;\", \"1 var\"],\n\t\t[\"var x,y;\", \"2 var\"],\n\t\t[\"var x=1,y=2;\", \"3 var\"],\n\t\t[\"var x,y=2;\", \"4 var\"],\n\t\t// empty\n\t\t[\";\", \"1 empty\"],\n\t\t[\"\\n;\", \"2 empty\"],\n\t\t// expression statement\n\t\t[\"x;\", \"1 expression statement\"],\n\t\t[\"5;\", \"2 expression statement\"],\n\t\t[\"1+2;\", \"3 expression statement\"],\n\t\t// if\n\t\t[\"if (c) x; else y;\", \"1 if statement\"],\n\t\t[\"if (c) x;\", \"2 if statement\"],\n\t\t[\"if (c) {} else {};\", \"3 if statement\"],\n\t\t[\"if (c1) if (c2) s1; else s2;\", \"4 if statement\"],\n\t\t// while\n\t\t[\"do s; while (e);\", \"1 while statement\"],\n\t\t[\"do { s; } while (e);\", \"2 while statement\"],\n\t\t[\"while (e) s;\", \"3 while statement\"],\n\t\t[\"while (e) { s; };\", \"4 while statement\"],\n\t\t// for\n\t\t[\"for (;;) ;\", \"1 for statement\"],\n\t\t[\"for (;c;x++) x;\", \"2 for statement\"],\n\t\t[\"for (i;i<len;++i){};\", \"3 for statement\"],\n\t\t[\"for (var i=0;i<len;++i) {};\", \"4 for statement\"],\n\t\t[\"for (var i=0,j=0;;){};\", \"5 for statement\"],\n\t\t//[\"for (x in b; c; u) {};\", \"6 for statement\"],\n\t\t[\"for ((x in b); c; u) {};\", \"7 for statement\"],\n\t\t[\"for (x in a);\", \"8 for statement\"],\n\t\t[\"for (var x in a){};\", \"9 for statement\"],\n\t\t[\"for (var x=5 in a) {};\", \"10 for statement\"],\n\t\t[\"for (var x = a in b in c) {};\", \"11 for statement\"],\n\t\t[\"for (var x=function(){a+b;}; a<b; ++i) some;\", \"11 for statement, testing for parsingForHeader reset with the function\"],\n\t\t[\"for (var x=function(){for (x=0; x<15; ++x) alert(foo); }; a<b; ++i) some;\", \"11 for statement, testing for parsingForHeader reset with the function\"],\n\t\t// flow statements\n\t\t[\"while(1){ continue; }\", \"1 flow statement\"],\n\t\t[\"label: while(1){ continue label; }\", \"2 flow statement\"],\n\t\t[\"while(1){ break; }\", \"3 flow statement\"],\n\t\t[\"somewhere: while(1){ break somewhere; }\", \"4 flow statement\"],\n\t\t[\"while(1){ continue /* comment */ ; }\", \"5 flow statement\"],\n\t\t[\"while(1){ continue \\n; }\", \"6 flow statement\"],\n\t\t[\"(function(){ return; })()\", \"7 flow statement\"],\n\t\t[\"(function(){ return 0; })()\", \"8 flow statement\"],\n\t\t[\"(function(){ return 0 + \\n 1; })()\", \"9 flow statement\"],\n\t\t// with\n\t\t[\"with (e) s;\", \"with statement\"],\n\t\t// switch\n\t\t[\"switch (e) { case x: s; };\", \"1 switch statement\"],\n\t\t[\"switch (e) { case x: s1;s2; default: s3; case y: s4; };\", \"2 switch statement\"],\n\t\t[\"switch (e) { default: s1; case x: s2; case y: s3; };\", \"3 switch statement\"],\n\t\t[\"switch (e) { default: s; };\", \"4 switch statement\"],\n\t\t[\"switch (e) { case x: s1; case y: s2; };\", \"5 switch statement\"],\n\t\t// labels\n\t\t[\"foo : x;\", \" flow statement\"],\n\t\t// throw\n\t\t[\"throw x;\", \"1 throw statement\"],\n\t\t[\"throw x\\n;\", \"2 throw statement\"],\n\t\t// try catch finally\n\t\t[\"try { s1; } catch (e) { s2; };\", \"1 trycatchfinally statement\"],\n\t\t[\"try { s1; } finally { s2; };\", \"2 trycatchfinally statement\"],\n\t\t[\"try { s1; } catch (e) { s2; } finally { s3; };\", \"3 trycatchfinally statement\"],\n\t\t// debugger\n\t\t[\"debugger;\", \"debugger statement\"],\n\t\t// function decl\n\t\t[\"function f(x) { e; return x; };\", \"1 function declaration\"],\n\t\t[\"function f() { x; y; };\", \"2 function declaration\"],\n\t\t[\"function f(x,y) { var z; return x; };\", \"3 function declaration\"],\n\t\t// function exp\n\t\t[\"(function f(x) { return x; });\", \"1 function expression\"],\n\t\t[\"(function empty() {;});\", \"2 function expression\"],\n\t\t[\"(function empty() {;});\", \"3 function expression\"],\n\t\t[\"(function (x) {; });\", \"4 function expression\"],\n\t\t// program\n\t\t[\"var x; function f(){;}; null;\", \"1 program\"],\n\t\t[\";;\", \"2 program\"],\n\t\t[\"{ x; y; z; }\", \"3 program\"],\n\t\t[\"function f(){ function g(){;}};\", \"4 program\"],\n\t\t[\"x;\\n/*foo*/\\n\t;\", \"5 program\"],\n\n\t\t// asi\n\t\t[\"foo: while(1){ continue \\n foo; }\", \"1 asi\"],\n\t\t[\"foo: while(1){ break \\n foo; }\", \"2 asi\"],\n\t\t[\"(function(){ return\\nfoo; })()\", \"3 asi\"],\n\t\t[\"var x; { 1 \\n 2 } 3\", \"4 asi\"],\n\t\t[\"ab \t /* hi */\\ncd\", \"5 asi\"],\n\t\t[\"ab/*\\n*/cd\", \"6 asi (multi line multilinecomment counts as eol)\"],\n\t\t[\"foo: while(1){ continue /* wtf \\n busta */ foo; }\", \"7 asi illegal with multi line comment\"],\n\t\t[\"function f() { s }\", \"8 asi\"],\n\t\t[\"function f() { return }\", \"9 asi\"],\n\n\t\t// use strict\n                // XXX: some of these should actually fail?\n                //      no support for \"use strict\" yet...\n\t\t['\"use strict\"; \\'bla\\'\\n; foo;', \"1 directive\"],\n\t\t['(function() { \"use strict\"; \\'bla\\';\\n foo; });', \"2 directive\"],\n\t\t['\"use\\\\n strict\";', \"3 directive\"],\n\t\t['foo; \"use strict\";', \"4 directive\"],\n\n\t\t// tests from http://es5conform.codeplex.com/\n\n\t\t['\"use strict\"; var o = { eval: 42};', \"8.7.2-3-1-s: the use of eval as property name is allowed\"],\n\t\t['({foo:0,foo:1});', 'Duplicate property name allowed in not strict mode'],\n\t\t['function foo(a,a){}', 'Duplicate parameter name allowed in not strict mode'],\n\t\t['(function foo(eval){})', 'Eval allowed as parameter name in non strict mode'],\n\t\t['(function foo(arguments){})', 'Arguments allowed as parameter name in non strict mode'],\n\n\t\t// empty programs\n\n\t\t['', '1 Empty program'],\n\t\t['// test', '2 Empty program'],\n\t\t['//test\\n', '3 Empty program'],\n\t\t['\\n// test', '4 Empty program'],\n\t\t['\\n// test\\n', '5 Empty program'],\n\t\t['/* */', '6 Empty program'],\n\t\t['/*\\ns,fd\\n*/', '7 Empty program'],\n\t\t['/*\\ns,fd\\n*/\\n', '8 Empty program'],\n\t\t['  \t', '9 Empty program'],\n\t\t['  /*\\nsmeh*/\t\\n   ', '10 Empty program'],\n\n\t\t// trailing whitespace\n\n\t\t['a  ', '1 Trailing whitespace'],\n\t\t['a /* something */', '2 Trailing whitespace'],\n\t\t['a\\n\t// hah', '3 Trailing whitespace'],\n\t\t['/abc/de//f', '4 Trailing whitespace'],\n\t\t['/abc/de/*f*/\\n\t', '5 Trailing whitespace'],\n\n\t\t// things the parser tripped over at one point or the other (prevents regression bugs)\n\t\t['for (x;function(){ a\\nb };z) x;', 'for header with function body forcing ASI'],\n\t\t['c=function(){return;return};', 'resetting noAsi after literal'],\n\t\t['d\\nd()', 'asi exception causing token overflow'],\n\t\t['for(;;){x=function(){}}', 'function expression in a for header'],\n\t\t['for(var k;;){}', 'parser failing due to ASI accepting the incorrect \"for\" rule'],\n\t\t['({get foo(){ }})', 'getter with empty function body'],\n\t\t['\\nreturnr', 'eol causes return statement to ignore local search requirement'],\n\t\t[' / /', '1 whitespace before regex causes regex to fail?'],\n\t\t['/ // / /', '2 whitespace before regex causes regex to fail?'],\n\t\t['/ / / / /', '3 whitespace before regex causes regex to fail?'],\n\n\t\t['\\n\\t// Used for trimming whitespace\\n\\ttrimLeft = /^\\\\s+/;\\n\\ttrimRight = /\\\\s+$/;\\t\\n','turned out this didnt crash (the test below did), but whatever.'],\n\t\t['/[\\\\/]/;', 'escaped forward slash inside class group (would choke on fwd slash)'],\n\t\t['/[/]/;', 'also broke but is valid in es5 (not es3)'],\n\t\t['({get:5});','get property name thats not a getter'],\n\t\t['({set:5});','set property name thats not a setter'],\n\t\t['l !== \"px\" && (d.style(h, c, (k || 1) + l), j = (k || 1) / f.cur() * j, d.style(h, c, j + l)), i[1] && (k = (i[1] === \"-=\" ? -1 : 1) * k + j), f.custom(j, k, l)', 'this choked regex/div at some point'],\n\t\t['(/\\'/g, \\'\\\\\\\\\\\\\\'\\') + \"\\'\";', 'the sequence of escaped characters confused the tokenizer'],\n                ['if (true) /=a/.test(\"a\");', 'regexp starting with \"=\" in not obvious context (not implied by preceding token)']\n\t];\n\n\tfor (var i=0; i<inps.length; ++i) {\n\t\tcallback(i, inps[i][0], inps[i][1]);\n\t};\n};\n"
  },
  {
    "path": "test/unit/compress/expected/1e21.js",
    "content": "1e20,1e21"
  },
  {
    "path": "test/unit/compress/expected/array1.js",
    "content": "[],Array(1),[1,2,3]\n"
  },
  {
    "path": "test/unit/compress/expected/array2.js",
    "content": "(function(){var a=function(){};return new a(1,2,3,4)})()\n"
  },
  {
    "path": "test/unit/compress/expected/array3.js",
    "content": "(function(){function a(){}return new a(1,2,3,4)})()\n"
  },
  {
    "path": "test/unit/compress/expected/array4.js",
    "content": "(function(){function a(){}(function(){return new a(1,2,3)})()})()\n"
  },
  {
    "path": "test/unit/compress/expected/assignment.js",
    "content": "a=1,b=a,c=1,d=b,e=d,longname=2;if(longname+1){x=3;if(x)var z=7}z=1,y=1,x=1,g+=1,h=g,++i,j=i,i++,j=i+17"
  },
  {
    "path": "test/unit/compress/expected/concatstring.js",
    "content": "var a=a+\"a\"+\"b\"+1+c,b=a+\"c\"+\"ds\"+123+c,c=a+\"c\"+123+d+\"ds\"+c"
  },
  {
    "path": "test/unit/compress/expected/const.js",
    "content": "var a=13,b=1/3"
  },
  {
    "path": "test/unit/compress/expected/div-with-regexp.js",
    "content": "print(a/ /[a-z]/)\n"
  },
  {
    "path": "test/unit/compress/expected/empty-blocks.js",
    "content": "function bar(){return--x}function foo(){while(bar());}function mak(){for(;;);}var x=5\n"
  },
  {
    "path": "test/unit/compress/expected/forstatement.js",
    "content": "a=func(),b=z;for(a++;i<10;i++)alert(i);var z=1;g=2;for(;i<10;i++)alert(i);var a=2;for(var i=1;i<10;i++)alert(i)"
  },
  {
    "path": "test/unit/compress/expected/if-not.js",
    "content": "_,_"
  },
  {
    "path": "test/unit/compress/expected/if.js",
    "content": "var a=1;a==1?a=2:a=17"
  },
  {
    "path": "test/unit/compress/expected/ifreturn.js",
    "content": "function a(a){return a==1?2:17}"
  },
  {
    "path": "test/unit/compress/expected/ifreturn2.js",
    "content": "function x(a){return typeof a==\"object\"?a:a===42?0:a*2}function y(a){return typeof a==\"object\"?a:null}\n"
  },
  {
    "path": "test/unit/compress/expected/infinite.js",
    "content": "with({get NaN(){throw 0},get Infinity(){throw 0}})0/0,0/0,1/0,-1/0"
  },
  {
    "path": "test/unit/compress/expected/issue10.js",
    "content": "function f(){var a;return(a=\"a\")?a:a}f()"
  },
  {
    "path": "test/unit/compress/expected/issue11.js",
    "content": "new(A,B),new(A||B),new(X?A:B)"
  },
  {
    "path": "test/unit/compress/expected/issue13.js",
    "content": "var a=/^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?([^:\\/?#])(?::(\\d))?)?(..?$|(?:[^?#\\/]\\/))([^?#]*)(?:\\?([^#]))?(?:#(.))?/"
  },
  {
    "path": "test/unit/compress/expected/issue14.js",
    "content": "var a={\"\\b\":\"\\\\b\",\"\t\":\"\\\\t\",\"\\n\":\"\\\\n\",\"\\f\":\"\\\\f\",\"\\r\":\"\\\\r\",'\"':'\\\\\"',\"\\\\\":\"\\\\\\\\\"}\n"
  },
  {
    "path": "test/unit/compress/expected/issue16.js",
    "content": "var a=3250441966"
  },
  {
    "path": "test/unit/compress/expected/issue17.js",
    "content": "var a=function(b){b(),a()}"
  },
  {
    "path": "test/unit/compress/expected/issue20.js",
    "content": "1\n"
  },
  {
    "path": "test/unit/compress/expected/issue21.js",
    "content": "var a=0;switch(a){case 0:a++}"
  },
  {
    "path": "test/unit/compress/expected/issue25.js",
    "content": "a:break a;console.log(1)\n"
  },
  {
    "path": "test/unit/compress/expected/issue27.js",
    "content": "(a?b:c)?d:e"
  },
  {
    "path": "test/unit/compress/expected/issue278.js",
    "content": "if(!x)debugger\n"
  },
  {
    "path": "test/unit/compress/expected/issue28.js",
    "content": "o={\".5\":.5},o={.5:.5},o={.5:.5}"
  },
  {
    "path": "test/unit/compress/expected/issue29.js",
    "content": "result=function(){return 1}()"
  },
  {
    "path": "test/unit/compress/expected/issue30.js",
    "content": "var a=8,b=4,c=4"
  },
  {
    "path": "test/unit/compress/expected/issue34.js",
    "content": "var a={};a[\"this\"]=1,a.that=2"
  },
  {
    "path": "test/unit/compress/expected/issue349.js",
    "content": "(function(){var a;if(noFreeCakes)return;return a=new FreeCake,a})()(function(){var a;if(noFreeCakes)return;return a=new FreeCake,a})()(function(){var a;if(noFreeCakes)return;return a=new FreeCake,a})()\n"
  },
  {
    "path": "test/unit/compress/expected/issue353.js",
    "content": "function test(){debugger;return}\n"
  },
  {
    "path": "test/unit/compress/expected/issue372.js",
    "content": "\"use strict\";function a(){function a(){function a(){void \"c\"}function b(){\"salmon\";void \"d\"}void \"b\"}function b(){\"salmon\";function a(){void \"f\";for(var a=0;a<10;a++)var b=function(){void \"g\"}()}void \"e\"}void \"a\"}\n"
  },
  {
    "path": "test/unit/compress/expected/issue4.js",
    "content": "var a=2e3,b=.002,c=2e-5"
  },
  {
    "path": "test/unit/compress/expected/issue471.js",
    "content": "((a||b)&&c)()\n"
  },
  {
    "path": "test/unit/compress/expected/issue48.js",
    "content": "var s,i;s=\"\",i=0"
  },
  {
    "path": "test/unit/compress/expected/issue50.js",
    "content": "function bar(a){try{foo()}catch(b){alert(\"Exception caught (foo not defined)\")}alert(a)}bar(10)\n"
  },
  {
    "path": "test/unit/compress/expected/issue53.js",
    "content": "x=(y,z)\n"
  },
  {
    "path": "test/unit/compress/expected/issue54.1.js",
    "content": "foo+\"\",a.toString(16),b.toString.call(c)\n"
  },
  {
    "path": "test/unit/compress/expected/issue68.js",
    "content": "function f(){function b(){}if(a)return;b()}\n"
  },
  {
    "path": "test/unit/compress/expected/issue69.js",
    "content": "[(a,b)]\n"
  },
  {
    "path": "test/unit/compress/expected/issue9.js",
    "content": "var a={a:1,b:2}"
  },
  {
    "path": "test/unit/compress/expected/issues222_324.js",
    "content": "!(function(){\"use strict\";var a,b,c}),!function(){\"use strict\";var a,b},!function(){\"use strict\";var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B},!function(){\"use strict\";var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B}\n"
  },
  {
    "path": "test/unit/compress/expected/mangle.js",
    "content": "(function(){var a=function b(a,b,c){return b}})()\n"
  },
  {
    "path": "test/unit/compress/expected/null_string.js",
    "content": "var nullString=\"\\0\""
  },
  {
    "path": "test/unit/compress/expected/strict-equals.js",
    "content": "typeof a==\"string\",b+\"\"!=c+\"\",d<e==f<g"
  },
  {
    "path": "test/unit/compress/expected/var.js",
    "content": "var a=1,b=2"
  },
  {
    "path": "test/unit/compress/expected/whitespace.js",
    "content": "function id(a){return a}\n"
  },
  {
    "path": "test/unit/compress/expected/with.js",
    "content": "with({});\n"
  },
  {
    "path": "test/unit/compress/test/1e21.js",
    "content": "1e20,1e21"
  },
  {
    "path": "test/unit/compress/test/array1.js",
    "content": "new Array();\nnew Array(1);\nnew Array(1, 2, 3);\n"
  },
  {
    "path": "test/unit/compress/test/array2.js",
    "content": "(function(){\n        var Array = function(){};\n        return new Array(1, 2, 3, 4);\n})();\n"
  },
  {
    "path": "test/unit/compress/test/array3.js",
    "content": "(function(){\n        return new Array(1, 2, 3, 4);\n        function Array() {};\n})();\n"
  },
  {
    "path": "test/unit/compress/test/array4.js",
    "content": "(function(){\n        (function(){\n                return new Array(1, 2, 3);\n        })();\n        function Array(){};\n})();\n"
  },
  {
    "path": "test/unit/compress/test/assignment.js",
    "content": "a=1;\nb=a;\nc=1;\nd=b;\ne=d;\nlongname=2;\nif (longname+1) {\n    x=3;\n    if (x) var z = 7;\n}\nz=1,y=1,x=1\n\ng+=1;\nh=g;\n\n++i;\nj=i;\n\ni++;\nj=i+17;"
  },
  {
    "path": "test/unit/compress/test/concatstring.js",
    "content": "var a = a + \"a\" + \"b\" + 1 + c;\nvar b = a + \"c\" + \"ds\" + 123 + c;\nvar c = a + \"c\" + 123 + d + \"ds\" + c;"
  },
  {
    "path": "test/unit/compress/test/const.js",
    "content": "// test that the calculation is fold to 13\r\nvar a = 1 + 2 * 6;\r\n\r\n// test that it isn't replaced with 0.3333 because that is more characters\r\nvar b = 1/3;"
  },
  {
    "path": "test/unit/compress/test/div-with-regexp.js",
    "content": "print(a / /[a-z]/);\n"
  },
  {
    "path": "test/unit/compress/test/empty-blocks.js",
    "content": "var x = 5;\nfunction bar() { return --x; }\nfunction foo() { while (bar()); }\nfunction mak() { for(;;); }\n"
  },
  {
    "path": "test/unit/compress/test/forstatement.js",
    "content": "a=func();\nb=z;\nfor (a++; i < 10; i++) { alert(i); }\n\nvar z=1;\ng=2;\nfor (; i < 10; i++) { alert(i); }\n\nvar a = 2;\nfor (var i = 1; i < 10; i++) { alert(i); }\n"
  },
  {
    "path": "test/unit/compress/test/if-not.js",
    "content": "if(_);if(_);else;"
  },
  {
    "path": "test/unit/compress/test/if.js",
    "content": "var a = 1;\r\nif (a == 1) {\r\n\ta = 2;\r\n} else {\r\n\ta = 17;\r\n}\r\n"
  },
  {
    "path": "test/unit/compress/test/ifreturn.js",
    "content": "function a(b) {\r\n\tif (b == 1) {\r\n\t\treturn 2;\r\n\t} else {\r\n\t\treturn 17;\r\n\t}\r\n\r\n\treturn 3;\r\n}"
  },
  {
    "path": "test/unit/compress/test/ifreturn2.js",
    "content": "function x(a) {\n    if (typeof a === 'object')\n        return a;\n\n    if (a === 42)\n        return 0;\n\n    return a * 2;\n}\n\nfunction y(a) {\n    if (typeof a === 'object')\n        return a;\n\n    return null;\n};\n"
  },
  {
    "path": "test/unit/compress/test/infinite.js",
    "content": "with({get NaN(){throw 0},get Infinity(){throw 0}})(1/0)/(1/0),0/0,123456/0,-123456/0"
  },
  {
    "path": "test/unit/compress/test/issue10.js",
    "content": "function f() { var a; if (a = 'a') { return a; } else { return a; } }; f();"
  },
  {
    "path": "test/unit/compress/test/issue11.js",
    "content": "new (A, B)\nnew (A || B)\nnew (X ? A : B)"
  },
  {
    "path": "test/unit/compress/test/issue13.js",
    "content": "var a = /^(?:(\\w+):)?(?:\\/\\/(?:(?:([^:@\\/]*):?([^:@\\/]*))?@)?([^:\\/?#])(?::(\\d))?)?(..?$|(?:[^?#\\/]\\/))([^?#]*)(?:\\?([^#]))?(?:#(.))?/;"
  },
  {
    "path": "test/unit/compress/test/issue14.js",
    "content": "var a = {'\\b': '\\\\b', '\\t': '\\\\t', '\\n': '\\\\n', '\\f': '\\\\f', '\\r': '\\\\r', '\"' : '\\\\\"', '\\\\': '\\\\\\\\'};"
  },
  {
    "path": "test/unit/compress/test/issue16.js",
    "content": "var a = 0xC1BDCEEE;"
  },
  {
    "path": "test/unit/compress/test/issue17.js",
    "content": "var a = function(b) {\n    b();\n    a()\n}\n"
  },
  {
    "path": "test/unit/compress/test/issue20.js",
    "content": "{a: 1}"
  },
  {
    "path": "test/unit/compress/test/issue21.js",
    "content": "var a = 0;\nswitch(a) {\n    case 0:\n        a++;\n        break;\n}"
  },
  {
    "path": "test/unit/compress/test/issue25.js",
    "content": "label1 : {\n    label2 : {\n        break label2;\n        console.log(2);\n    }\n    console.log(1);\n}"
  },
  {
    "path": "test/unit/compress/test/issue27.js",
    "content": "(a ? b : c) ? d : e"
  },
  {
    "path": "test/unit/compress/test/issue278.js",
    "content": "if (!x) debugger;\n"
  },
  {
    "path": "test/unit/compress/test/issue28.js",
    "content": "o = {'.5':.5}\no = {'0.5':.5}\no = {0.5:.5}"
  },
  {
    "path": "test/unit/compress/test/issue29.js",
    "content": "result=(function(){ return 1;})()"
  },
  {
    "path": "test/unit/compress/test/issue30.js",
    "content": "var a = 1 << 3;\nvar b = 8 >> 1;\nvar c = 8 >>> 1;"
  },
  {
    "path": "test/unit/compress/test/issue34.js",
    "content": "var a = {};\na[\"this\"] = 1;\na[\"that\"] = 2;"
  },
  {
    "path": "test/unit/compress/test/issue349.js",
    "content": "(function () {\n  var cake\n  if (noFreeCakes) return /* I would\n                              insert something\n                              there, but I'm sort\n                              of lazy so whatever.\n  */ cake = new FreeCake()\n  return cake\n})()\n\n(function () {\n  var cake\n  if (noFreeCakes) return /* I would insert something there, */ /*\n                             but I'm sort of lazy so\n  */ /*                      whatever. */ cake = new FreeCake()\n  return cake\n})()\n\n(function () {\n  var cake\n  if (noFreeCakes) return // I would insert something there, but I'm sort of lazy so whatever.\n  cake = new FreeCake()\n  return cake\n})()\n\n"
  },
  {
    "path": "test/unit/compress/test/issue353.js",
    "content": "function test() {\n  debugger;\n  return;\n}\n"
  },
  {
    "path": "test/unit/compress/test/issue372.js",
    "content": "\"use strict\";\n\"use strict\";\n\nfunction a() {\n    void \"a\";\n    function b() {\n        \"use strict\";\n        void \"b\";\n        function c() {\n            \"use strict\";\n            void \"c\";\n        }\n        function d() {\n            \"salmon\";\n            void \"d\";\n        }\n    }\n    function e() {\n        \"salmon\";\n        void \"e\";\n        function f() {\n            \"use strict\";\n            \"salmon\";\n            void \"f\";\n            for (var i = 0; i < 10; i++) var g = function() {\n                \"use strict\";\n                \"salmon\";\n                void \"g\";\n            }();\n        }\n    }\n};\n"
  },
  {
    "path": "test/unit/compress/test/issue4.js",
    "content": "var a = 2e3;\nvar b = 2e-3;\nvar c = 2e-5;"
  },
  {
    "path": "test/unit/compress/test/issue471.js",
    "content": "((a || b) && c)();\n"
  },
  {
    "path": "test/unit/compress/test/issue48.js",
    "content": "var s, i; s = ''; i = 0;"
  },
  {
    "path": "test/unit/compress/test/issue50.js",
    "content": "function bar(a) {\n        try {\n                foo();\n        } catch(e) {\n                alert(\"Exception caught (foo not defined)\");\n        }\n        alert(a);               // 10 in FF, \"[object Error]\" in IE\n}\nbar(10);\n"
  },
  {
    "path": "test/unit/compress/test/issue53.js",
    "content": "x = (y, z)\n"
  },
  {
    "path": "test/unit/compress/test/issue54.1.js",
    "content": "foo.toString();\na.toString(16);\nb.toString.call(c);\n"
  },
  {
    "path": "test/unit/compress/test/issue68.js",
    "content": "function f() {\n        if (a) return;\n        g();\n        function g(){}\n};\n"
  },
  {
    "path": "test/unit/compress/test/issue69.js",
    "content": "[(a,b)]\n"
  },
  {
    "path": "test/unit/compress/test/issue9.js",
    "content": "var a = {\n    a: 1,\n    b: 2, // <-- trailing comma\n};\n"
  },
  {
    "path": "test/unit/compress/test/issues222_324.js",
    "content": "!function() {\n  'use strict';\n\n  var 七,  // issue #222\n      $１,  // issue #222\n      ლ_ಠ益ಠ_ლ;  // issue #324\n};\n\n!function() {\n  'use strict';\n\n  // test if Unicode canonical equivalence is ignored\n  var \\u006E\\u0303,\n      \\u00F1;\n};\n\n!function() {\n  'use strict';\n\n  var \\uFF38,  // Ｘ Lu (third to last)\n      \\uFF58,  // ｘ Ll (third to last)\n      \\u1FBC,  // ᾼ Lt (third to last)\n      \\uFF70,  // ｰ Lm (third to last)\n      \\u4DB3,  // 䶳 Lo (third to last within a range)\n      \\u97CA,  // 韊 Lo (third to last within a range)\n      \\uD7A1,  // 힡 Lo (third to last within a range)\n      \\uFFDA,  // ￚ Lo (third to last)\n      \\uA6ED,  // ꛭ Nl (third to last)\n      \\u0024,  // $\n      \\u005F,  // _\n      \\u0024\\uFF38,  // Ｘ Lu (third to last)\n      \\u0024\\uFF58,  // ｘ Ll (third to last)\n      \\u0024\\u1FBC,  // ᾼ Lt (third to last)\n      \\u0024\\uFF70,  // ｰ Lm (third to last)\n      \\u0024\\u4DB3,  // 䶳 Lo (third to last within a range)\n      \\u0024\\u97CA,  // 韊 Lo (third to last within a range)\n      \\u0024\\uD7A1,  // 힡 Lo (third to last within a range)\n      \\u0024\\uFFDA,  // ￚ Lo (third to last)\n      \\u0024\\uA6ED,  // ꛭ Nl (third to last)\n      \\u0024\\uFE24,  // ︤  Mn (third to last)\n      \\u0024\\uABE9,  // ꯩ Mc (third to last)\n      \\u0024\\uFF17,  // ７ Nd (third to last)\n      \\u0024\\uFE4E,  // ﹎ Pc (third to last)\n      \\u0024\\u200C,  // ZERO WIDTH NON-JOINER\n      \\u0024\\u200D,  // ZERO WIDTH JOINER\n      \\u0024\\u0024,  // $\n      \\u0024\\u005F;  // _\n};\n\n!function() {\n  'use strict';\n\n  var Ｘ,\n      ｘ,\n      ᾼ,\n      ｰ,\n      䶳,\n      韊,\n      힡,\n      ￚ,\n      ꛭ,\n      $,\n      _,\n      $Ｘ,\n      $ｘ,\n      $ᾼ,\n      $ｰ,\n      $䶳,\n      $韊,\n      $힡,\n      $ￚ,\n      $ꛭ,\n      $︤,\n      $ꯩ,\n      $７,\n      $﹎,\n      $‌,\n      $‍,\n      $$,\n      $_;\n};\n\n"
  },
  {
    "path": "test/unit/compress/test/mangle.js",
    "content": "(function() {\n    var x = function fun(a, fun, b) {\n        return fun;\n    };\n}());\n"
  },
  {
    "path": "test/unit/compress/test/null_string.js",
    "content": "var nullString = \"\\0\""
  },
  {
    "path": "test/unit/compress/test/strict-equals.js",
    "content": "typeof a === 'string'\nb + \"\" !== c + \"\"\nd < e === f < g\n"
  },
  {
    "path": "test/unit/compress/test/var.js",
    "content": "// var declarations after each other should be combined\r\nvar a = 1;\r\nvar b = 2;"
  },
  {
    "path": "test/unit/compress/test/whitespace.js",
    "content": "function id(a) {\n  \f// Form-Feed\n  \u000b// Vertical Tab\n   // No-Break Space\n  ᠎// Mongolian Vowel Separator\n   // En quad\n   // Em quad\n   // En space\n   // Em space\n   // Three-Per-Em Space\n   // Four-Per-Em Space\n   // Six-Per-Em Space\n   // Figure Space\n   // Punctuation Space\n   // Thin Space\n   // Hair Space\n   // Narrow No-Break Space\n   // Medium Mathematical Space\n  　// Ideographic Space\n  return a;\n}\n"
  },
  {
    "path": "test/unit/compress/test/with.js",
    "content": "with({}) {\n};\n"
  },
  {
    "path": "test/unit/scripts.js",
    "content": "global.DIGITS_OVERRIDE_FOR_TESTING = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789\";\n\nvar fs = require('fs'),\n\tuglify = require('../../uglify-js'),\n\tjsp = uglify.parser,\n\tnodeunit = require('nodeunit'),\n\tpath = require('path'),\n\tpro = uglify.uglify;\n\nvar Script = process.binding('evals').Script;\n\nvar scriptsPath = __dirname;\n\nfunction compress(code) {\n\tvar ast = jsp.parse(code);\n\tast = pro.ast_mangle(ast, { mangle: true });\n\tast = pro.ast_squeeze(ast, { no_warnings: true });\n        ast = pro.ast_squeeze_more(ast);\n\treturn pro.gen_code(ast);\n};\n\nvar testDir = path.join(scriptsPath, \"compress\", \"test\");\nvar expectedDir = path.join(scriptsPath, \"compress\", \"expected\");\n\nfunction getTester(script) {\n\treturn function(test) {\n\t\tvar testPath = path.join(testDir, script);\n\t\tvar expectedPath = path.join(expectedDir, script);\n\t\tvar content = fs.readFileSync(testPath, 'utf-8');\n\t\tvar outputCompress = compress(content);\n\n\t\t// Check if the noncompressdata is larger or same size as the compressed data\n\t\ttest.ok(content.length >= outputCompress.length);\n\n\t\t// Check that a recompress gives the same result\n\t\tvar outputReCompress = compress(content);\n\t\ttest.equal(outputCompress, outputReCompress);\n\n\t\t// Check if the compressed output is what is expected\n\t\tvar expected = fs.readFileSync(expectedPath, 'utf-8');\n\t\ttest.equal(outputCompress, expected.replace(/(\\r?\\n)+$/, \"\"));\n\n\t\ttest.done();\n\t};\n};\n\nvar tests = {};\n\nvar scripts = fs.readdirSync(testDir);\nfor (var i in scripts) {\n\tvar script = scripts[i];\n\tif (/\\.js$/.test(script)) {\n\t\ttests[script] = getTester(script);\n\t}\n}\n\nmodule.exports = nodeunit.testCase(tests);\n"
  },
  {
    "path": "tmp/hoist.js",
    "content": "function foo(arg1, arg2, arg3, arg4, arg5, arg6) {\n        var a = 5;\n        {\n                var d = 10, mak = 20, buz = 30;\n                var q = buz * 2;\n        }\n        if (moo) {\n                var a, b, c;\n        }\n        for (var arg1 = 0, d = 20; arg1 < 10; ++arg1)\n                console.log(arg3);\n        for (var i in mak) {}\n        for (j in d) {}\n        var d;\n\n        function test() {\n                \n        };\n\n        //test();\n\n        (function moo(first, second){\n                console.log(first);\n        })(1);\n\n        (function moo(first, second){\n                console.log(moo());\n        })(1);\n}\n\n\nvar foo;\nvar bar;\n"
  },
  {
    "path": "tmp/instrument.js",
    "content": "// sample on how to use the parser and walker API to instrument some code\n\nvar jsp = require(\"uglify-js\").parser;\nvar pro = require(\"uglify-js\").uglify;\n\nfunction instrument(code) {\n        var ast = jsp.parse(code, false, true); // true for the third arg specifies that we want\n                                                // to have start/end tokens embedded in the\n                                                // statements\n        var w = pro.ast_walker();\n\n        // we're gonna need this to push elements that we're currently looking at, to avoid\n        // endless recursion.\n        var analyzing = [];\n        function do_stat() {\n                var ret;\n                if (this[0].start && analyzing.indexOf(this) < 0) {\n                        // without the `analyzing' hack, w.walk(this) would re-enter here leading\n                        // to infinite recursion\n                        analyzing.push(this);\n                        ret = [ \"splice\", // XXX: \"block\" is safer\n                                [ [ \"stat\",\n                                    [ \"call\", [ \"name\", \"trace\" ],\n                                      [ [ \"string\", this[0].toString() ],\n                                        [ \"num\", this[0].start.line ],\n                                        [ \"num\", this[0].start.col ],\n                                        [ \"num\", this[0].end.line ],\n                                        [ \"num\", this[0].end.col ]]]],\n                                  w.walk(this) ]];\n                        analyzing.pop(this);\n                }\n                return ret;\n        };\n        var new_ast = w.with_walkers({\n                \"stat\"     : do_stat,\n                \"label\"    : do_stat,\n                \"break\"    : do_stat,\n                \"continue\" : do_stat,\n                \"debugger\" : do_stat,\n                \"var\"      : do_stat,\n                \"const\"    : do_stat,\n                \"return\"   : do_stat,\n                \"throw\"    : do_stat,\n                \"try\"      : do_stat,\n                \"defun\"    : do_stat,\n                \"if\"       : do_stat,\n                \"while\"    : do_stat,\n                \"do\"       : do_stat,\n                \"for\"      : do_stat,\n                \"for-in\"   : do_stat,\n                \"switch\"   : do_stat,\n                \"with\"     : do_stat\n        }, function(){\n                return w.walk(ast);\n        });\n        return pro.gen_code(new_ast, { beautify: true });\n}\n\n\n\n\n////// test code follows.\n\nvar code = instrument(test.toString());\nconsole.log(code);\n\nfunction test() {\n        // simple stats\n        a = 5;\n        c += a + b;\n        \"foo\";\n\n        // var\n        var foo = 5;\n        const bar = 6, baz = 7;\n\n        // switch block.  note we can't track case lines the same way.\n        switch (\"foo\") {\n            case \"foo\":\n                return 1;\n            case \"bar\":\n                return 2;\n        }\n\n        // for/for in\n        for (var i = 0; i < 5; ++i) {\n                console.log(\"Hello \" + i);\n        }\n        for (var i in [ 1, 2, 3]) {\n                console.log(i);\n        }\n\n        // note however that the following is broken.  I guess we\n        // should add the block brackets in this case...\n        for (var i = 0; i < 5; ++i)\n                console.log(\"foo\");\n}\n"
  },
  {
    "path": "tmp/test.js",
    "content": "#! /usr/bin/env node\n\nglobal.sys = require(/^v0\\.[012]/.test(process.version) ? \"sys\" : \"util\");\nvar fs = require(\"fs\");\nvar uglify = require(\"uglify-js\"), // symlink ~/.node_libraries/uglify-js.js to ../uglify-js.js\n    jsp = uglify.parser,\n    pro = uglify.uglify;\n\nvar code = fs.readFileSync(\"hoist.js\", \"utf8\");\nvar ast = jsp.parse(code);\n\nast = pro.ast_lift_variables(ast);\n\nvar w = pro.ast_walker();\nast = w.with_walkers({\n        \"function\": function() {\n                var node = w.dive(this); // walk depth first\n                console.log(pro.gen_code(node, { beautify: true }));\n                return node;\n        },\n        \"name\": function(name) {\n                return [ this[0], \"X\" ];\n        }\n}, function(){\n        return w.walk(ast);\n});\n\nconsole.log(pro.gen_code(ast, {\n        beautify: true\n}));\n"
  },
  {
    "path": "uglify-js.js",
    "content": "//convienence function(src, [options]);\nfunction uglify(orig_code, options){\n  options || (options = {});\n  var jsp = uglify.parser;\n  var pro = uglify.uglify;\n\n  var ast = jsp.parse(orig_code, options.strict_semicolons); // parse code and get the initial AST\n  ast = pro.ast_mangle(ast, options.mangle_options); // get a new AST with mangled names\n  ast = pro.ast_squeeze(ast, options.squeeze_options); // get an AST with compression optimizations\n  var final_code = pro.gen_code(ast, options.gen_options); // compressed code here\n  return final_code;\n};\n\nuglify.parser = require(\"./lib/parse-js\");\nuglify.uglify = require(\"./lib/process\");\nuglify.consolidator = require(\"./lib/consolidator\");\n\nmodule.exports = uglify\n"
  }
]