Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add node_modules to git repo and Makefile

  • Loading branch information...
commit 5f80f8f88484eb4a8b585cf9ebb9c082cabcb28c 1 parent 2d064c8
@caolan authored
Showing with 8,168 additions and 2 deletions.
  1. +0 −1  .gitignore
  2. +1 −1  Makefile
  3. +1 −0  node_modules/.bin/uglifyjs
  4. +17 −0 node_modules/qbox/.project
  5. +4 −0 node_modules/qbox/.settings/.jsdtscope
  6. +1 −0  node_modules/qbox/.settings/org.eclipse.wst.jsdt.ui.superType.container
  7. +1 −0  node_modules/qbox/.settings/org.eclipse.wst.jsdt.ui.superType.name
  8. +221 −0 node_modules/qbox/lib-cov/qbox.js
  9. +122 −0 node_modules/qbox/lib/qbox.js
  10. +23 −0 node_modules/qbox/package.json
  11. +58 −0 node_modules/qbox/readme.md
  12. +188 −0 node_modules/qbox/tests/qbox.js
  13. +2 −0  node_modules/tap-assert/AUTHORS
  14. +23 −0 node_modules/tap-assert/LICENSE
  15. +3 −0  node_modules/tap-assert/README.md
  16. +396 −0 node_modules/tap-assert/assert.js
  17. +29 −0 node_modules/tap-assert/package.json
  18. +4 −0 node_modules/tap-producer/README.md
  19. +51 −0 node_modules/tap-producer/node_modules/inherits/README.md
  20. +29 −0 node_modules/tap-producer/node_modules/inherits/inherits.js
  21. +7 −0 node_modules/tap-producer/node_modules/inherits/package.json
  22. +2 −0  node_modules/tap-producer/node_modules/tap-results/README.md
  23. +11 −0 node_modules/tap-producer/node_modules/tap-results/package.json
  24. +68 −0 node_modules/tap-producer/node_modules/tap-results/results.js
  25. +19 −0 node_modules/tap-producer/node_modules/yamlish/LICENSE
  26. +20 −0 node_modules/tap-producer/node_modules/yamlish/README.md
  27. +9 −0 node_modules/tap-producer/node_modules/yamlish/package.json
  28. +221 −0 node_modules/tap-producer/node_modules/yamlish/yamlish.js
  29. +12 −0 node_modules/tap-producer/package.json
  30. +113 −0 node_modules/tap-producer/tap-producer.js
  31. +4 −0 node_modules/uglify-js/.gitignore
  32. +1,026 −0 node_modules/uglify-js/README.html
  33. +571 −0 node_modules/uglify-js/README.org
  34. +317 −0 node_modules/uglify-js/bin/uglifyjs
  35. +75 −0 node_modules/uglify-js/docstyle.css
  36. +75 −0 node_modules/uglify-js/lib/object-ast.js
  37. +1,339 −0 node_modules/uglify-js/lib/parse-js.js
  38. +2,001 −0 node_modules/uglify-js/lib/process.js
  39. +51 −0 node_modules/uglify-js/lib/squeeze-more.js
  40. +24 −0 node_modules/uglify-js/package.json
  41. +28 −0 node_modules/uglify-js/test/beautify.js
  42. +403 −0 node_modules/uglify-js/test/testparser.js
  43. +1 −0  node_modules/uglify-js/test/unit/compress/expected/array1.js
  44. +1 −0  node_modules/uglify-js/test/unit/compress/expected/array2.js
  45. +1 −0  node_modules/uglify-js/test/unit/compress/expected/array3.js
  46. +1 −0  node_modules/uglify-js/test/unit/compress/expected/array4.js
  47. +1 −0  node_modules/uglify-js/test/unit/compress/expected/assignment.js
  48. +1 −0  node_modules/uglify-js/test/unit/compress/expected/concatstring.js
  49. +1 −0  node_modules/uglify-js/test/unit/compress/expected/const.js
  50. +1 −0  node_modules/uglify-js/test/unit/compress/expected/empty-blocks.js
  51. +1 −0  node_modules/uglify-js/test/unit/compress/expected/forstatement.js
  52. +1 −0  node_modules/uglify-js/test/unit/compress/expected/if.js
  53. +1 −0  node_modules/uglify-js/test/unit/compress/expected/ifreturn.js
  54. +1 −0  node_modules/uglify-js/test/unit/compress/expected/ifreturn2.js
  55. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue10.js
  56. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue11.js
  57. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue13.js
  58. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue14.js
  59. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue16.js
  60. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue17.js
  61. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue20.js
  62. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue21.js
  63. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue25.js
  64. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue27.js
  65. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue28.js
  66. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue29.js
  67. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue30.js
  68. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue34.js
  69. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue4.js
  70. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue48.js
  71. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue50.js
  72. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue53.js
  73. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue54.1.js
  74. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue68.js
  75. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue69.js
  76. +1 −0  node_modules/uglify-js/test/unit/compress/expected/issue9.js
  77. +1 −0  node_modules/uglify-js/test/unit/compress/expected/mangle.js
  78. +1 −0  node_modules/uglify-js/test/unit/compress/expected/null_string.js
  79. +1 −0  node_modules/uglify-js/test/unit/compress/expected/strict-equals.js
  80. +1 −0  node_modules/uglify-js/test/unit/compress/expected/var.js
  81. +1 −0  node_modules/uglify-js/test/unit/compress/expected/whitespace.js
  82. +1 −0  node_modules/uglify-js/test/unit/compress/expected/with.js
  83. +3 −0  node_modules/uglify-js/test/unit/compress/test/array1.js
  84. +4 −0 node_modules/uglify-js/test/unit/compress/test/array2.js
  85. +4 −0 node_modules/uglify-js/test/unit/compress/test/array3.js
  86. +6 −0 node_modules/uglify-js/test/unit/compress/test/array4.js
  87. +20 −0 node_modules/uglify-js/test/unit/compress/test/assignment.js
  88. +3 −0  node_modules/uglify-js/test/unit/compress/test/concatstring.js
  89. +5 −0 node_modules/uglify-js/test/unit/compress/test/const.js
  90. +4 −0 node_modules/uglify-js/test/unit/compress/test/empty-blocks.js
  91. +10 −0 node_modules/uglify-js/test/unit/compress/test/forstatement.js
  92. +6 −0 node_modules/uglify-js/test/unit/compress/test/if.js
  93. +9 −0 node_modules/uglify-js/test/unit/compress/test/ifreturn.js
  94. +16 −0 node_modules/uglify-js/test/unit/compress/test/ifreturn2.js
  95. +1 −0  node_modules/uglify-js/test/unit/compress/test/issue10.js
  96. +3 −0  node_modules/uglify-js/test/unit/compress/test/issue11.js
  97. +1 −0  node_modules/uglify-js/test/unit/compress/test/issue13.js
  98. +1 −0  node_modules/uglify-js/test/unit/compress/test/issue14.js
  99. +1 −0  node_modules/uglify-js/test/unit/compress/test/issue16.js
  100. +4 −0 node_modules/uglify-js/test/unit/compress/test/issue17.js
  101. +1 −0  node_modules/uglify-js/test/unit/compress/test/issue20.js
  102. +6 −0 node_modules/uglify-js/test/unit/compress/test/issue21.js
  103. +7 −0 node_modules/uglify-js/test/unit/compress/test/issue25.js
  104. +1 −0  node_modules/uglify-js/test/unit/compress/test/issue27.js
  105. +3 −0  node_modules/uglify-js/test/unit/compress/test/issue28.js
  106. +1 −0  node_modules/uglify-js/test/unit/compress/test/issue29.js
  107. +3 −0  node_modules/uglify-js/test/unit/compress/test/issue30.js
  108. +3 −0  node_modules/uglify-js/test/unit/compress/test/issue34.js
  109. +3 −0  node_modules/uglify-js/test/unit/compress/test/issue4.js
  110. +1 −0  node_modules/uglify-js/test/unit/compress/test/issue48.js
  111. +9 −0 node_modules/uglify-js/test/unit/compress/test/issue50.js
  112. +1 −0  node_modules/uglify-js/test/unit/compress/test/issue53.js
  113. +3 −0  node_modules/uglify-js/test/unit/compress/test/issue54.1.js
  114. +5 −0 node_modules/uglify-js/test/unit/compress/test/issue68.js
  115. +1 −0  node_modules/uglify-js/test/unit/compress/test/issue69.js
  116. +4 −0 node_modules/uglify-js/test/unit/compress/test/issue9.js
  117. +5 −0 node_modules/uglify-js/test/unit/compress/test/mangle.js
  118. +1 −0  node_modules/uglify-js/test/unit/compress/test/null_string.js
  119. +3 −0  node_modules/uglify-js/test/unit/compress/test/strict-equals.js
  120. +3 −0  node_modules/uglify-js/test/unit/compress/test/var.js
  121. +21 −0 node_modules/uglify-js/test/unit/compress/test/whitespace.js
  122. +2 −0  node_modules/uglify-js/test/unit/compress/test/with.js
  123. +55 −0 node_modules/uglify-js/test/unit/scripts.js
  124. +33 −0 node_modules/uglify-js/tmp/hoist.js
  125. +97 −0 node_modules/uglify-js/tmp/instrument.js
  126. +138 −0 node_modules/uglify-js/tmp/instrument2.js
  127. +30 −0 node_modules/uglify-js/tmp/test.js
  128. +17 −0 node_modules/uglify-js/uglify-js.js
View
1  .gitignore
@@ -3,4 +3,3 @@ stamp-build
*~
gmon.out
v8.log
-node_modules
View
2  Makefile
@@ -140,7 +140,7 @@ build: stamp-build
stamp-build: $(wildcard deps/* lib/*.js)
touch $@;
mkdir -p $(BUILDDIR)/nodeunit
- cp -R bin deps index.js lib package.json share $(BUILDDIR)/nodeunit
+ cp -R bin node_modules deps index.js lib package.json share $(BUILDDIR)/nodeunit
printf '#!/bin/sh\n$(NODEJS) $(NODEJSLIBDIR)/$(PACKAGE)/bin/nodeunit $$@' > $(BUILDDIR)/nodeunit.sh
test:
View
1  node_modules/.bin/uglifyjs
View
17 node_modules/qbox/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Queue Box</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ </natures>
+</projectDescription>
View
4 node_modules/qbox/.settings/.jsdtscope
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="output" path=""/>
+</classpath>
View
1  node_modules/qbox/.settings/org.eclipse.wst.jsdt.ui.superType.container
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.JRE_CONTAINER
View
1  node_modules/qbox/.settings/org.eclipse.wst.jsdt.ui.superType.name
@@ -0,0 +1 @@
+Global
View
221 node_modules/qbox/lib-cov/qbox.js
@@ -0,0 +1,221 @@
+/* automatically generated by JSCoverage - do not edit */
+if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
+if (! _$jscoverage['qbox.js']) {
+ _$jscoverage['qbox.js'] = [];
+ _$jscoverage['qbox.js'][1] = 0;
+ _$jscoverage['qbox.js'][2] = 0;
+ _$jscoverage['qbox.js'][4] = 0;
+ _$jscoverage['qbox.js'][6] = 0;
+ _$jscoverage['qbox.js'][7] = 0;
+ _$jscoverage['qbox.js'][8] = 0;
+ _$jscoverage['qbox.js'][9] = 0;
+ _$jscoverage['qbox.js'][11] = 0;
+ _$jscoverage['qbox.js'][12] = 0;
+ _$jscoverage['qbox.js'][14] = 0;
+ _$jscoverage['qbox.js'][16] = 0;
+ _$jscoverage['qbox.js'][19] = 0;
+ _$jscoverage['qbox.js'][22] = 0;
+ _$jscoverage['qbox.js'][23] = 0;
+ _$jscoverage['qbox.js'][24] = 0;
+ _$jscoverage['qbox.js'][26] = 0;
+ _$jscoverage['qbox.js'][34] = 0;
+ _$jscoverage['qbox.js'][35] = 0;
+ _$jscoverage['qbox.js'][36] = 0;
+ _$jscoverage['qbox.js'][37] = 0;
+ _$jscoverage['qbox.js'][38] = 0;
+ _$jscoverage['qbox.js'][40] = 0;
+ _$jscoverage['qbox.js'][41] = 0;
+ _$jscoverage['qbox.js'][49] = 0;
+ _$jscoverage['qbox.js'][50] = 0;
+ _$jscoverage['qbox.js'][53] = 0;
+ _$jscoverage['qbox.js'][55] = 0;
+ _$jscoverage['qbox.js'][56] = 0;
+ _$jscoverage['qbox.js'][57] = 0;
+ _$jscoverage['qbox.js'][58] = 0;
+ _$jscoverage['qbox.js'][60] = 0;
+ _$jscoverage['qbox.js'][62] = 0;
+ _$jscoverage['qbox.js'][63] = 0;
+ _$jscoverage['qbox.js'][65] = 0;
+ _$jscoverage['qbox.js'][66] = 0;
+ _$jscoverage['qbox.js'][67] = 0;
+ _$jscoverage['qbox.js'][71] = 0;
+ _$jscoverage['qbox.js'][74] = 0;
+ _$jscoverage['qbox.js'][82] = 0;
+ _$jscoverage['qbox.js'][84] = 0;
+ _$jscoverage['qbox.js'][85] = 0;
+ _$jscoverage['qbox.js'][86] = 0;
+ _$jscoverage['qbox.js'][87] = 0;
+ _$jscoverage['qbox.js'][93] = 0;
+ _$jscoverage['qbox.js'][94] = 0;
+ _$jscoverage['qbox.js'][101] = 0;
+ _$jscoverage['qbox.js'][102] = 0;
+ _$jscoverage['qbox.js'][103] = 0;
+ _$jscoverage['qbox.js'][104] = 0;
+ _$jscoverage['qbox.js'][105] = 0;
+ _$jscoverage['qbox.js'][106] = 0;
+ _$jscoverage['qbox.js'][110] = 0;
+ _$jscoverage['qbox.js'][111] = 0;
+ _$jscoverage['qbox.js'][112] = 0;
+ _$jscoverage['qbox.js'][113] = 0;
+ _$jscoverage['qbox.js'][114] = 0;
+ _$jscoverage['qbox.js'][118] = 0;
+ _$jscoverage['qbox.js'][120] = 0;
+ _$jscoverage['qbox.js'][121] = 0;
+}
+_$jscoverage['qbox.js'][1]++;
+var util = require("util");
+_$jscoverage['qbox.js'][2]++;
+var EventEmitter = require("events").EventEmitter;
+_$jscoverage['qbox.js'][4]++;
+function QBox(steps) {
+ _$jscoverage['qbox.js'][6]++;
+ var isReady = false;
+ _$jscoverage['qbox.js'][7]++;
+ var queue = [];
+ _$jscoverage['qbox.js'][8]++;
+ var isStop = false;
+ _$jscoverage['qbox.js'][9]++;
+ var startingCallback;
+ _$jscoverage['qbox.js'][11]++;
+ var ticks;
+ _$jscoverage['qbox.js'][12]++;
+ var countingSteps = null;
+ _$jscoverage['qbox.js'][14]++;
+ if (typeof steps == "number") {
+ _$jscoverage['qbox.js'][16]++;
+ countingSteps = steps;
+ }
+ else {
+ _$jscoverage['qbox.js'][19]++;
+ addTicks();
+ }
+ _$jscoverage['qbox.js'][22]++;
+ this.ready = (function (callback) {
+ _$jscoverage['qbox.js'][23]++;
+ if (isReady && ! isStop) {
+ _$jscoverage['qbox.js'][24]++;
+ callback();
+ }
+ else {
+ _$jscoverage['qbox.js'][26]++;
+ queue.push(callback);
+ }
+});
+ _$jscoverage['qbox.js'][34]++;
+ this.start = (function () {
+ _$jscoverage['qbox.js'][35]++;
+ if (! isStop) {
+ _$jscoverage['qbox.js'][36]++;
+ isReady = true;
+ _$jscoverage['qbox.js'][37]++;
+ queue.forEach((function (callback) {
+ _$jscoverage['qbox.js'][38]++;
+ callback();
+}));
+ _$jscoverage['qbox.js'][40]++;
+ queue = [];
+ _$jscoverage['qbox.js'][41]++;
+ if (startingCallback) {
+ _$jscoverage['qbox.js'][41]++;
+ startingCallback();
+ }
+ }
+});
+ _$jscoverage['qbox.js'][49]++;
+ this.onStart = (function (callback) {
+ _$jscoverage['qbox.js'][50]++;
+ startingCallback = callback;
+});
+ _$jscoverage['qbox.js'][53]++;
+ this.tick = (function (step) {
+ _$jscoverage['qbox.js'][55]++;
+ if (countingSteps != null) {
+ _$jscoverage['qbox.js'][56]++;
+ countingSteps--;
+ _$jscoverage['qbox.js'][57]++;
+ if (countingSteps == 0) {
+ _$jscoverage['qbox.js'][58]++;
+ this.start();
+ }
+ }
+ else {
+ _$jscoverage['qbox.js'][60]++;
+ if (ticks && ticks instanceof Array) {
+ _$jscoverage['qbox.js'][62]++;
+ var index = ticks.indexOf(step);
+ _$jscoverage['qbox.js'][63]++;
+ if (index >= 0) {
+ _$jscoverage['qbox.js'][65]++;
+ ticks.splice(index, 1);
+ _$jscoverage['qbox.js'][66]++;
+ if (ticks.length == 0) {
+ _$jscoverage['qbox.js'][67]++;
+ this.start();
+ }
+ }
+ else {
+ _$jscoverage['qbox.js'][71]++;
+ throw new Error("Invalid step: '" + step + "' provided");
+ }
+ }
+ else {
+ _$jscoverage['qbox.js'][74]++;
+ throw new Error("Cannot tick - no steps are provided");
+ }
+ }
+});
+ _$jscoverage['qbox.js'][82]++;
+ this.timeout = (function (amount, callback) {
+ _$jscoverage['qbox.js'][84]++;
+ if (! isStop) {
+ _$jscoverage['qbox.js'][85]++;
+ setTimeout((function () {
+ _$jscoverage['qbox.js'][86]++;
+ if (! isReady && ! isStop) {
+ _$jscoverage['qbox.js'][87]++;
+ callback(ticks);
+ }
+}), amount);
+ }
+});
+ _$jscoverage['qbox.js'][93]++;
+ this.stop = (function () {
+ _$jscoverage['qbox.js'][94]++;
+ isStop = true;
+});
+ _$jscoverage['qbox.js'][101]++;
+ this.reset = (function () {
+ _$jscoverage['qbox.js'][102]++;
+ isReady = false;
+ _$jscoverage['qbox.js'][103]++;
+ isStop = false;
+ _$jscoverage['qbox.js'][104]++;
+ addTicks();
+ _$jscoverage['qbox.js'][105]++;
+ if (countingSteps != null) {
+ _$jscoverage['qbox.js'][106]++;
+ countingSteps = steps;
+ }
+});
+ _$jscoverage['qbox.js'][110]++;
+ function addTicks() {
+ _$jscoverage['qbox.js'][111]++;
+ if (steps && steps.length > 0) {
+ _$jscoverage['qbox.js'][112]++;
+ ticks = [];
+ _$jscoverage['qbox.js'][113]++;
+ steps.forEach((function (tick) {
+ _$jscoverage['qbox.js'][114]++;
+ ticks.push(tick);
+}));
+ }
+}
+}
+_$jscoverage['qbox.js'][118]++;
+;
+_$jscoverage['qbox.js'][120]++;
+exports.create = (function (steps) {
+ _$jscoverage['qbox.js'][121]++;
+ return new QBox(steps);
+});
+_$jscoverage['qbox.js'].source = ["var util = require('util');","var EventEmitter = require('events').EventEmitter;","","function QBox(steps) {","\t","\tvar isReady = false;","\tvar queue = [];","\tvar isStop = false;","\tvar startingCallback;","","\tvar ticks;","\tvar countingSteps = null;","","\tif(typeof(steps) == 'number') {","\t\t//used for steps in a number","\t\tcountingSteps = steps;","\t} else {","\t\t//used for steps as an array","\t\taddTicks(); //copy steps into ticks","\t}","","\tthis.ready = function(callback) {","\t\tif(isReady &amp;&amp; !isStop) {","\t\t\tcallback();","\t\t} else {","\t\t\tqueue.push(callback);","\t\t}","\t};","\t","\t/**","\t\tStart the QBox and execute all the callbacks in the queue","\t\tand clear the queue","\t*/","\tthis.start = function() {","\t\tif(!isStop) {","\t\t\tisReady = true;","\t\t\tqueue.forEach(function(callback) {","\t\t\t\tcallback();","\t\t\t});","\t\t\tqueue = [];","\t\t\tif(startingCallback) startingCallback();","\t\t}","\t};","","\t/**","\t\tAdd a single callback to call each and every time ","\t\tQbox starting (mostely used with reset())","\t*/","\tthis.onStart = function(callback) {","\t\tstartingCallback = callback;","\t};","\t","\tthis.tick = function(step) {","\t\t","\t\tif(countingSteps != null) {","\t\t\tcountingSteps--;","\t\t\tif(countingSteps == 0) {","\t\t\t\tthis.start();","\t\t\t}","\t\t} else if(ticks &amp;&amp; ticks instanceof Array) {","\t\t\t","\t\t\tvar index = ticks.indexOf(step);","\t\t\tif(index &gt;= 0) {","\t\t\t\t","\t\t\t\tticks.splice(index, 1);","\t\t\t\tif(ticks.length == 0) {","\t\t\t\t\tthis.start();","\t\t\t\t}","\t\t\t} else {","\t\t\t\t","\t\t\t\tthrow new Error(\"Invalid step: '\" + step + \"' provided\");","\t\t\t}","\t\t} else {","\t\t\tthrow new Error(\"Cannot tick - no steps are provided\");","\t\t}","\t};","\t","\t/**","\t * @param amount - no of millies fot timeout","\t * callback - function([]){} containing remaining steps","\t */","\tthis.timeout = function(amount, callback) {","\t\t","\t\tif(!isStop) {","\t\t\tsetTimeout(function() {","\t\t\t\tif(!isReady &amp;&amp; !isStop) {","\t\t\t\t\tcallback(ticks);","\t\t\t\t}","\t\t\t}, amount);","\t\t}","\t};","\t","\tthis.stop = function() {","\t\tisStop = true;","\t};","","\t/**","\t\tReset the QBOX and make is available to start again","\t\tAnd does not clean callbacks in the queue and onStart Callback","\t*/","\tthis.reset = function() {","\t\tisReady = false;","\t\tisStop = false;","\t\taddTicks();","\t\tif(countingSteps != null) {","\t\t\tcountingSteps = steps;","\t\t}","\t};","","\tfunction addTicks() {","\t\tif(steps &amp;&amp; steps.length &gt; 0) {","\t\t\tticks = [];","\t\t\tsteps.forEach(function(tick) {","\t\t\t\tticks.push(tick);","\t\t\t});","\t\t}","\t}","};","","exports.create = function(steps) {","\treturn new QBox(steps);","};"];
View
122 node_modules/qbox/lib/qbox.js
@@ -0,0 +1,122 @@
+var util = require('util');
+var EventEmitter = require('events').EventEmitter;
+
+function QBox(steps) {
+
+ var isReady = false;
+ var queue = [];
+ var isStop = false;
+ var startingCallback;
+
+ var ticks;
+ var countingSteps = null;
+
+ if(typeof(steps) == 'number') {
+ //used for steps in a number
+ countingSteps = steps;
+ } else {
+ //used for steps as an array
+ addTicks(); //copy steps into ticks
+ }
+
+ this.ready = function(callback) {
+ if(isReady && !isStop) {
+ callback();
+ } else {
+ queue.push(callback);
+ }
+ };
+
+ /**
+ Start the QBox and execute all the callbacks in the queue
+ and clear the queue
+ */
+ this.start = function() {
+ if(!isStop) {
+ isReady = true;
+ queue.forEach(function(callback) {
+ callback();
+ });
+ queue = [];
+ if(startingCallback) startingCallback();
+ }
+ };
+
+ /**
+ Add a single callback to call each and every time
+ Qbox starting (mostely used with reset())
+ */
+ this.onStart = function(callback) {
+ startingCallback = callback;
+ };
+
+ this.tick = function(step) {
+
+ if(countingSteps != null) {
+ countingSteps--;
+ if(countingSteps == 0) {
+ this.start();
+ }
+ } else if(ticks && ticks instanceof Array) {
+
+ var index = ticks.indexOf(step);
+ if(index >= 0) {
+
+ ticks.splice(index, 1);
+ if(ticks.length == 0) {
+ this.start();
+ }
+ } else {
+
+ throw new Error("Invalid step: '" + step + "' provided");
+ }
+ } else {
+ throw new Error("Cannot tick - no steps are provided");
+ }
+ };
+
+ /**
+ * @param amount - no of millies fot timeout
+ * callback - function([]){} containing remaining steps
+ */
+ this.timeout = function(amount, callback) {
+
+ if(!isStop) {
+ setTimeout(function() {
+ if(!isReady && !isStop) {
+ callback(ticks);
+ }
+ }, amount);
+ }
+ };
+
+ this.stop = function() {
+ isStop = true;
+ };
+
+ /**
+ Reset the QBOX and make is available to start again
+ And does not clean callbacks in the queue and onStart Callback
+ */
+ this.reset = function() {
+ isReady = false;
+ isStop = false;
+ addTicks();
+ if(countingSteps != null) {
+ countingSteps = steps;
+ }
+ };
+
+ function addTicks() {
+ if(steps && steps.length > 0) {
+ ticks = [];
+ steps.forEach(function(tick) {
+ ticks.push(tick);
+ });
+ }
+ }
+};
+
+exports.create = function(steps) {
+ return new QBox(steps);
+};
View
23 node_modules/qbox/package.json
@@ -0,0 +1,23 @@
+{
+ "name": "qbox",
+ "version": "0.1.7",
+ "directories": {
+ "lib": "./lib"
+ },
+ "main": "./lib/qbox",
+ "description": "JQuery like queue solution for NodeJs",
+ "author": "Arunoda Susiripala <arunoda.susiripala@gmail.com>",
+ "homepage": "https://github.com/arunoda/qbox",
+ "licenses": [
+ {
+ "type": "The MIT License",
+ "url": "http://www.opensource.org/licenses/mit-license.php"
+ }
+ ],
+
+ "repository" :
+ {
+ "type" : "git",
+ "url" : "git@github.com:arunoda/qbox.git"
+ }
+}
View
58 node_modules/qbox/readme.md
@@ -0,0 +1,58 @@
+QBox - Quick Flow Control library for NodeJS
+=======================================
+
+Introduction
+------------
+
+There are whole a bunch of NodeJS Flow Control libraries exists.
+In order to use most of them you need change the way how you program.
+Or learn some new syntax.
+
+*Qbox* is meant for people who loves to code using their natural style
+but also to control the flow of the code as they wish.
+
+Install
+---------
+ npm install qbox
+
+Usage
+-----
+
+### Complete After Something happens
+
+I need to do some tasks after I connect've connect with the database
+
+ var db = qbox.create();
+
+ mydatabase.connect(function() {
+ $.start();
+ });
+
+ $.ready(function() {
+ //do something
+ });
+
+ //at somewhere else in your programme
+ $.ready(function() {
+ //do some other stuff
+ });
+
+### Complete After Some Few things happens
+
+I need to do some task after I'm connected to database and registry
+
+ var go = qbox.ready(['db', 'registry']);
+
+ mydatabase.connect(function() { go.tick('db'); });
+ registry.connect(function() { go.tick('db'); });
+
+ go.ready(function() {
+ //do something
+ });
+
+ //timeout after 5 seconds
+ go.timeout(5000, function() {
+ //show the errors
+ });
+
+Browse [Tests](https://github.com/arunoda/qbox/blob/master/tests/qbox.js) for more usage patterns
View
188 node_modules/qbox/tests/qbox.js
@@ -0,0 +1,188 @@
+var qbox = require("qbox");
+
+exports.testSteps = function(test) {
+
+ test.expect(1);
+ var $ = qbox.create(["db1", "db2"]);
+ $.ready(function() {
+ test.ok(true);
+ });
+
+ $.tick("db1");
+ $.tick("db2");
+ test.done();
+};
+
+exports.testStepsInvalid = function(test) {
+
+ var $ = qbox.create(["db1", "db2"]);
+ $.ready(function() {
+ test.fail();
+ });
+
+ $.tick("db1");
+ test.throws(function() {
+ $.tick("db222");
+ });
+ test.done();
+};
+
+exports.testTimeout = function(test) {
+
+ test.expect(1);
+ var $ = qbox.create(["db1", "db2"]);
+ $.ready(function() {
+ test.fail();
+ });
+
+ $.tick("db1");
+ var start = new Date().getTime();
+ $.timeout(200, function() {
+ var end = new Date().getTime();
+ if(end-start >= 200) {
+ test.ok(true);
+ test.done();
+ } else {
+ test.fail("Timeout time smaller");
+ }
+ });
+};
+
+exports.testStopWIthTick = function(test) {
+
+ var $ = qbox.create(["db1", "db2"]);
+ $.ready(function() {
+ test.fail("Should not execute after stops");
+ });
+
+ $.stop();
+ $.tick("db1");
+ $.tick("db2");
+ test.done();
+};
+
+exports.testStopWithoutTick = function(test) {
+
+ var $ = qbox.create();
+ $.start();
+ $.stop();
+ $.ready(function() {
+ test.fail("Should not execute after stops");
+ });
+
+ test.done();
+};
+
+exports.testAfterStopTimeout = function(test) {
+
+ var $ = qbox.create();
+ $.stop();
+ $.timeout(1000, function() {
+ test.fail("Should not call the timeout");
+ });
+
+ setTimeout(function() {
+ test.done();
+ }, 1500);
+};
+
+exports.testBeforeStopTimeout = function(test) {
+
+ var $ = qbox.create();
+
+ $.timeout(1000, function() {
+ test.fail("Should not call the timeout");
+ });
+ $.stop();
+ setTimeout(function() {
+ test.done();
+ }, 1500);
+};
+
+exports.testReset = function(test) {
+
+ var $ = qbox.create([1,2]);
+ $.tick(2);
+ $.reset();
+ $.tick(1);
+ $.tick(2);
+
+ $.ready(function() {
+ test.done();
+ });
+};
+
+exports.testResetAfterStop = function(test) {
+
+ test.expect(2);
+ var $ = qbox.create([1,2]);
+
+ $.ready(function() {
+ test.ok(true);
+ });
+
+ $.tick(2);
+ $.tick(1);
+ $.reset();
+ $.ready(function() {
+ test.ok(true);
+ });
+ $.tick(1);
+ $.tick(2);
+
+ test.done();
+};
+
+exports.testOnStart = function(test) {
+
+ test.expect(2);
+ var $ = qbox.create([1,2]);
+
+ $.onStart(function() {
+ test.ok(true);
+ });
+
+ $.tick(2);
+ $.tick(1);
+ $.reset();
+ $.tick(1);
+ $.tick(2);
+
+ test.done();
+};
+
+exports.testCountingSteps = function(test) {
+
+ test.expect(1);
+ var $ = qbox.create(4);
+ $.ready(function() {
+ test.ok(true);
+ });
+
+ [1,2,3,4].forEach(function(step) {
+ $.tick();
+ });
+ test.done();
+};
+
+exports.testCountingStepsWithReset = function(test) {
+
+ test.expect(2);
+ var $ = qbox.create(4);
+ $.ready(function() {
+ test.ok(true);
+ });
+
+ [1,2,3,4].forEach(function(step) {
+ $.tick();
+ });
+ $.reset();
+ $.ready(function() {
+ test.ok(true);
+ });
+ [1,2,3,4].forEach(function(step) {
+ $.tick();
+ });
+
+ test.done();
+};
View
2  node_modules/tap-assert/AUTHORS
@@ -0,0 +1,2 @@
+Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)
+baudehlo <helpme+github@gmail.com>
View
23 node_modules/tap-assert/LICENSE
@@ -0,0 +1,23 @@
+Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
View
3  node_modules/tap-assert/README.md
@@ -0,0 +1,3 @@
+An assert module for node-tap.
+
+More coming.
View
396 node_modules/tap-assert/assert.js
@@ -0,0 +1,396 @@
+// an assert module that returns tappable data for each assertion.
+
+module.exports = assert
+
+var syns = {}
+ , id = 1
+
+function assert (ok, message, extra) {
+ if (extra && extra.skip) return assert.skip(message, extra)
+
+ //console.error("assert %j", [ok, message, extra])
+ //if (extra && extra.skip) return assert.skip(message, extra)
+ //console.error("assert", [ok, message, extra])
+ ok = !!ok
+ var res = { id : id ++, ok: ok }
+
+ var caller = getCaller(extra && extra.error)
+ if (extra && extra.error) {
+ res.type = extra.error.name
+ res.message = extra.error.message
+ res.code = extra.error.code
+ || extra.error.type
+ res.errno = extra.error.errno
+ delete extra.error
+ }
+ if (caller.file) {
+ res.file = caller.file
+ res.line = +caller.line
+ res.column = +caller.column
+ }
+ res.stack = caller.stack
+
+ res.name = message || "(unnamed assert)"
+
+ if (extra) Object.keys(extra).forEach(function (k) {
+ if (!res.hasOwnProperty(k)) res[k] = extra[k]
+ })
+
+ // strings and objects are hard to diff by eye
+ if (!ok &&
+ res.hasOwnProperty("found") &&
+ res.hasOwnProperty("wanted") &&
+ res.found !== res.wanted) {
+ if (typeof res.wanted !== typeof res.found ||
+ typeof res.wanted === "object" && (!res.found || !res.wanted)) {
+ res.type = { found: typeof found
+ , wanted: typeof wanted }
+ } else if (typeof res.wanted === "string") {
+ res.diff = diffString(res.found, res.wanted)
+ } else if (typeof res.wanted === "object") {
+ res.diff = diffObject(res.found, res.wanted)
+ }
+ }
+
+ //console.error("assert return", res)
+
+ return res
+}
+assert.ok = assert
+syns.ok = [ "true", "assert" ]
+
+
+function notOk (ok, message, extra) {
+ return assert(!ok, message, extra)
+}
+assert.notOk = notOk
+syns.notOk = [ "false", "notok" ]
+
+function error (er, message, extra) {
+ if (!er) {
+ // just like notOk(er)
+ return assert(!er, message, extra)
+ }
+ message = message || er.message
+ extra = extra || {}
+ extra.error = er
+ return assert.fail(message, extra)
+}
+assert.error = error
+syns.error = [ "ifError", "ifErr", "iferror" ]
+
+
+function pass (message, extra) {
+ return assert(true, message, extra)
+}
+assert.pass = pass
+
+function fail (message, extra) {
+ //console.error("assert.fail", [message, extra])
+ //if (extra && extra.skip) return assert.skip(message, extra)
+ return assert(false, message, extra)
+}
+assert.fail = fail
+
+function skip (message, extra) {
+ //console.error("assert.skip", message, extra)
+ if (!extra) extra = {}
+ return { id: id ++, skip: true, name: message || "" }
+}
+assert.skip = skip
+
+function throws (fn, wanted, message, extra) {
+ if (typeof wanted === "string") {
+ extra = message
+ message = wanted
+ wanted = null
+ }
+
+ if (extra && extra.skip) return assert.skip(message, extra)
+
+ var found = null
+ try {
+ fn()
+ } catch (e) {
+ found = { name: e.name, message: e.message }
+ }
+
+ extra = extra || {}
+
+ extra.found = found
+ if (wanted) {
+ wanted = { name: wanted.name, message: wanted.message }
+ extra.wanted = wanted
+ }
+
+ if (!message) {
+ message = "Expected to throw"
+ if (wanted) message += ": "+wanted.name + " " + wanted.message
+ }
+
+ return (wanted) ? assert.similar(found, wanted, message, extra)
+ : assert.ok(found, message, extra)
+}
+assert.throws = throws
+
+
+function doesNotThrow (fn, message, extra) {
+ if (extra && extra.skip) return assert.skip(message, extra)
+ var found = null
+ try {
+ fn()
+ } catch (e) {
+ found = {name: e.name, message: e.message}
+ }
+ message = message || "Should not throw"
+
+ return assert.equal(found, null, message, extra)
+}
+assert.doesNotThrow = doesNotThrow
+
+
+function equal (a, b, message, extra) {
+ if (extra && extra.skip) return assert.skip(message, extra)
+ extra = extra || {}
+ message = message || "should be equal"
+ extra.found = a
+ extra.wanted = b
+ return assert(a === b, message, extra)
+}
+assert.equal = equal
+syns.equal = ["equals"
+ ,"isEqual"
+ ,"is"
+ ,"strictEqual"
+ ,"strictEquals"]
+
+
+function equivalent (a, b, message, extra) {
+ if (extra && extra.skip) return assert.skip(message, extra)
+ var extra = extra || {}
+ message = message || "should be equivalent"
+ extra.found = a
+ extra.wanted = b
+ return assert(stringify(a) === stringify(b), message, extra)
+}
+assert.equivalent = equivalent
+syns.equivalent = ["isEquivalent"
+ ,"looseEqual"
+ ,"looseEquals"
+ ,"isDeeply"
+ ,"same"
+ ,"deepEqual"
+ ,"deepEquals"]
+
+
+function inequal (a, b, message, extra) {
+ if (extra && extra.skip) return assert.skip(message, extra)
+ extra = extra || {}
+ message = message || "should not be equal"
+ extra.found = a
+ extra.doNotWant = b
+ return assert(a !== b, message, extra)
+}
+assert.inequal = inequal
+syns.inequal = ["notEqual"
+ ,"notEquals"
+ ,"isNotEqual"
+ ,"isNot"
+ ,"not"
+ ,"doesNotEqual"
+ ,"isInequal"]
+
+
+function inequivalent (a, b, message, extra) {
+ if (extra && extra.skip) return assert.skip(message, extra)
+ extra = extra || {}
+ message = message || "should not be equivalent"
+ extra.found = a
+ extra.doNotWant = b
+ return assert(stringify(a) !== stringify(b), message, extra)
+}
+assert.inequivalent = inequivalent
+syns.inequivalent = ["notEquivalent"
+ ,"notDeepEqual"
+ ,"notDeeply"
+ ,"isNotDeepEqual"
+ ,"isNotDeeply"
+ ,"isNotEquivalent"
+ ,"isInequivalent"]
+
+function similar (a, b, message, extra) {
+ if (extra && extra.skip) return assert.skip(message, extra)
+ // test that a has all the fields in b
+ message = message || "should be similar"
+ return equivalent(selectFields(a, b), b, message, extra)
+}
+assert.similar = similar
+syns.similar = ["isSimilar"
+ ,"has"
+ ,"hasFields"
+ ,"like"
+ ,"isLike"]
+
+function dissimilar (a, b, message, extra) {
+ if (extra && extra.skip) return assert.skip(message, extra)
+ // test that a has all the fields in b
+ message = message || "should be dissimilar"
+ return inequivalent(selectFields(a, b), b, message, extra)
+}
+assert.dissimilar = dissimilar
+syns.dissimilar = ["unsimilar"
+ ,"notSimilar"
+ ,"unlike"
+ ,"isUnlike"
+ ,"notLike"
+ ,"isNotLike"
+ ,"doesNotHave"
+ ,"isNotSimilar"
+ ,"isDissimilar"]
+
+function type (thing, t, message, extra) {
+ if (extra && extra.skip) return assert.skip(message, extra)
+ var name = t
+ if (typeof name === "function") name = name.name || "(anonymous ctor)"
+ //console.error("name=%s", name)
+ message = message || "type is "+name
+ var type = typeof thing
+ //console.error("type=%s", type)
+ if (!thing && type === "object") type = "null"
+ if (type === "object" && t !== "object") {
+ if (typeof t === "function") {
+ //console.error("it is a function!")
+ extra = extra || {}
+ extra.found = Object.getPrototypeOf(thing).constructor.name
+ extra.wanted = name
+ //console.error(thing instanceof t, name)
+ return assert.ok(thing instanceof t, message, extra)
+ }
+
+ //console.error("check prototype chain")
+ // check against classnames or objects in prototype chain, as well.
+ // type(new Error("asdf"), "Error")
+ // type(Object.create(foo), foo)
+ var p = thing
+ while (p = Object.getPrototypeOf(p)) {
+ if (p === t || p.constructor && p.constructor.name === t) {
+ type = name
+ break
+ }
+ }
+ }
+ //console.error(type, name, type === name)
+ return assert.equal(type, name, message, extra)
+}
+assert.type = type
+syns.type = ["isa"]
+
+// synonyms are helpful.
+Object.keys(syns).forEach(function (c) {
+ syns[c].forEach(function (s) {
+ Object.defineProperty(assert, s, { value: assert[c], enumerable: false })
+ })
+})
+
+// helpers below
+
+function selectFields (a, b) {
+ // get the values in A of the fields in B
+ var ret = Array.isArray(b) ? [] : {}
+ Object.keys(b).forEach(function (k) {
+ if (!a.hasOwnProperty(k)) return
+ var v = b[k]
+ , av = a[k]
+ if (v && av && typeof v === "object" && typeof av === "object") {
+ ret[k] = selectFields(av, v)
+ } else ret[k] = av
+ })
+ return ret
+}
+
+function stringify (a) {
+ return JSON.stringify(a, (function () {
+ var seen = []
+ , keys = []
+ return function (key, val) {
+ var s = seen.indexOf(val)
+ if (s !== -1) {
+ return "[Circular: "+keys[s]+"]"
+ }
+ if (val && typeof val === "object" || typeof val === "function") {
+ seen.push(val)
+ keys.push(val["!"] || val.name || key || "<root>")
+ if (typeof val === "function") {
+ return val.toString().split(/\n/)[0]
+ }
+ var proto = Object.getPrototypeOf(val)
+ }
+ return val
+ }})())
+}
+
+function diffString (f, w) {
+ if (w === f) return null
+ var p = 0
+ , l = w.length
+ while (p < l && w.charAt(p) === f.charAt(p)) p ++
+ w = stringify(w).substr(1).replace(/"$/, "")
+ f = stringify(f).substr(1).replace(/"$/, "")
+ return diff(f, w, p)
+}
+
+function diffObject (f, w) {
+ var f = stringify(f)
+ , w = stringify(w)
+ , l = w.length
+ if (f === w) return null
+ var p = 0
+ while (p < l && f.charAt(p) === w.charAt(p)) p ++
+ return diff(f, w, p)
+}
+
+function diff (f, w, p) {
+ if (w === f) return null
+ var i = p || 0 // it's going to be at least p. JSON can only be bigger.
+ , l = w.length
+ while (i < l && w.charAt(i) === f.charAt(i)) i ++
+ var pos = Math.max(0, i - 20)
+ w = w.substr(pos, 40)
+ f = f.substr(pos, 40)
+ var pointer = i - pos
+ return "FOUND: "+f+"\n"
+ + "WANTED: "+w+"\n"
+ + (new Array(pointer + 9).join(" "))
+ + "^ (at position = "+p+")"
+}
+
+function getCaller (er) {
+ // get the first file/line that isn't this file.
+ if (!er) er = new Error
+ var stack = er.stack || ""
+ stack = stack.split(/\n/)
+ for (var i = 1, l = stack.length; i < l; i ++) {
+ var s = stack[i].match(/\(([^):]+):([0-9]+):([0-9]+)\)$/)
+ if (!s) continue
+ var file = s[1]
+ , line = +s[2]
+ , col = +s[3]
+ if (file.indexOf(__dirname) === 0) continue
+ if (file.match(/tap-test\/test.js$/)) continue
+ else break
+ }
+ var res = {}
+ if (file && file !== __filename && !file.match(/tap-test\/test.js$/)) {
+ res.file = file
+ res.line = line
+ res.column = col
+ }
+
+ res.stack = stack.slice(1).map(function (s) {
+ return s.replace(/^\s*at\s*/, "")
+ })
+
+ return res
+}
+
+
View
29 node_modules/tap-assert/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "tap-assert",
+ "version": "0.0.10",
+ "description": "An assertion module that returns TAP result objects",
+ "main": "./assert.js",
+ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/tap-assert.git"
+ },
+ "keywords": [
+ "assert",
+ "test",
+ "tap"
+ ],
+ "license": {
+ "type": "MIT",
+ "url": "https://github.com/isaacs/tap-assert/raw/master/LICENSE"
+ },
+ "contributors": [
+ "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
+ "baudehlo <helpme+github@gmail.com>"
+ ],
+ "dependencies": {},
+ "devDependencies": {},
+ "engines": {
+ "node": "*"
+ }
+}
View
4 node_modules/tap-producer/README.md
@@ -0,0 +1,4 @@
+Sometimes, you need to produce some TAPs.
+
+Not like when you go to the store, and check to see if the melons are
+ripe. That's tapping on produce. This is different.
View
51 node_modules/tap-producer/node_modules/inherits/README.md
@@ -0,0 +1,51 @@
+A dead simple way to do inheritance in JS.
+
+ var inherits = require("inherits")
+
+ function Animal () {
+ this.alive = true
+ }
+ Animal.prototype.say = function (what) {
+ console.log(what)
+ }
+
+ inherits(Dog, Animal)
+ function Dog () {
+ Dog.super.apply(this)
+ }
+ Dog.prototype.sniff = function () {
+ this.say("sniff sniff")
+ }
+ Dog.prototype.bark = function () {
+ this.say("woof woof")
+ }
+
+ inherits(Chihuahua, Dog)
+ function Chihuahua () {
+ Chihuahua.super.apply(this)
+ }
+ Chihuahua.prototype.bark = function () {
+ this.say("yip yip")
+ }
+
+ // also works
+ function Cat () {
+ Cat.super.apply(this)
+ }
+ Cat.prototype.hiss = function () {
+ this.say("CHSKKSS!!")
+ }
+ inherits(Cat, Animal, {
+ meow: function () { this.say("miao miao") }
+ })
+ Cat.prototype.purr = function () {
+ this.say("purr purr")
+ }
+
+
+ var c = new Chihuahua
+ assert(c instanceof Chihuahua)
+ assert(c instanceof Dog)
+ assert(c instanceof Animal)
+
+The actual function is laughably small. 10-lines small.
View
29 node_modules/tap-producer/node_modules/inherits/inherits.js
@@ -0,0 +1,29 @@
+module.exports = inherits
+
+function inherits (c, p, proto) {
+ proto = proto || {}
+ var e = {}
+ ;[c.prototype, proto].forEach(function (s) {
+ Object.getOwnPropertyNames(s).forEach(function (k) {
+ e[k] = Object.getOwnPropertyDescriptor(s, k)
+ })
+ })
+ c.prototype = Object.create(p.prototype, e)
+ c.super = p
+}
+
+//function Child () {
+// Child.super.call(this)
+// console.error([this
+// ,this.constructor
+// ,this.constructor === Child
+// ,this.constructor.super === Parent
+// ,Object.getPrototypeOf(this) === Child.prototype
+// ,Object.getPrototypeOf(Object.getPrototypeOf(this))
+// === Parent.prototype
+// ,this instanceof Child
+// ,this instanceof Parent])
+//}
+//function Parent () {}
+//inherits(Child, Parent)
+//new Child
View
7 node_modules/tap-producer/node_modules/inherits/package.json
@@ -0,0 +1,7 @@
+{ "name" : "inherits"
+, "description": "A tiny simple way to do classic inheritance in js"
+, "version" : "1.0.0"
+, "keywords" : ["inheritance", "class", "klass", "oop", "object-oriented"]
+, "main" : "./inherits.js"
+, "repository" : "https://github.com/isaacs/inherits"
+, "author" : "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)" }
View
2  node_modules/tap-producer/node_modules/tap-results/README.md
@@ -0,0 +1,2 @@
+This is a module for keeping track of tap result objects, counting them
+up, etc.
View
11 node_modules/tap-producer/node_modules/tap-results/package.json
@@ -0,0 +1,11 @@
+{
+ "name": "tap-results",
+ "version": "0.0.2",
+ "description": "A util for keeping track of tap result objects",
+ "main": "./results.js",
+ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
+ "repository": "https://github.com/isaacs/tap-results",
+ "dependencies": {
+ "inherits": "~1.0.0"
+ }
+}
View
68 node_modules/tap-producer/node_modules/tap-results/results.js
@@ -0,0 +1,68 @@
+// A class for counting up results in a test harness.
+
+module.exports = Results
+
+var inherits = require("inherits")
+ , EventEmitter = require("events").EventEmitter
+
+inherits(Results, EventEmitter)
+
+function Results (r) {
+ //console.error("result constructor", r)
+ this.ok = true
+ this.addSet(r)
+}
+
+Results.prototype.addSet = function (r) {
+ //console.error("add set of results", r)
+ r = r || {ok: true}
+ ; [ "todo"
+ , "todoPass"
+ , "todoFail"
+ , "skip"
+ , "skipPass"
+ , "skipFail"
+ , "pass"
+ , "passTotal"
+ , "fail"
+ , "failTotal"
+ , "tests"
+ , "testsTotal" ].forEach(function (k) {
+ this[k] = (this[k] || 0) + (r[k] || 0)
+ //console.error([k, this[k]])
+ }, this)
+
+ this.ok = this.ok && r.ok && true
+ this.bailedOut = this.bailedOut || r.bailedOut || false
+ this.list = (this.list || []).concat(r.list || [])
+ this.emit("set", this.list)
+ //console.error("after addSet", this)
+}
+
+Results.prototype.add = function (r, addToList) {
+ //console.error("add result", r)
+ var pf = r.ok ? "pass" : "fail"
+ , PF = r.ok ? "Pass" : "Fail"
+
+ this.testsTotal ++
+ this[pf + "Total"] ++
+
+ if (r.skip) {
+ this["skip" + PF] ++
+ this.skip ++
+ } else if (r.todo) {
+ this["todo" + PF] ++
+ this.todo ++
+ } else {
+ this.tests ++
+ this[pf] ++
+ }
+
+ if (r.bailout || typeof r.bailout === "string") this.bailedOut = true
+ this.ok = !!(this.ok && r.ok)
+
+ if (addToList === false) return
+ this.list = this.list || []
+ this.list.push(r)
+ this.emit("result", r)
+}
View
19 node_modules/tap-producer/node_modules/yamlish/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Isaac Z. Schlueter <i@izs.me>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
View
20 node_modules/tap-producer/node_modules/yamlish/README.md
@@ -0,0 +1,20 @@
+This is a thingie to parse the "yamlish" format used to serialize
+objects in the TAP format.
+
+It's like yaml, but just a tiny little bit smaller.
+
+Usage:
+
+ var yamlish = require("yamlish")
+ // returns a string like:
+ /*
+ some:
+ object:
+ - full
+ - of
+ pretty: things
+ */
+ yamlish.encode({some:{object:["full", "of"]}, pretty:"things"})
+
+ // returns the object
+ yamlish.decode(someYamlishString)
View
9 node_modules/tap-producer/node_modules/yamlish/package.json
@@ -0,0 +1,9 @@
+{ "name" : "yamlish"
+, "description" : "Parser/encoder for the yamlish format"
+, "repository":"https://github.com/isaacs/yamlish"
+, "version" : "0.0.2"
+, "main" : "yamlish.js"
+, "keywords" : [ "yaml", "yamlish", "test", "anything", "protocol", "tap"]
+, "license" : { "type" : "MIT"
+ , "url" : "http://github.com/isaacs/yamlish/raw/master/LICENSE" }
+, "author" : "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)" }
View
221 node_modules/tap-producer/node_modules/yamlish/yamlish.js
@@ -0,0 +1,221 @@
+exports.encode = encode
+exports.decode = decode
+
+var seen = []
+function encode (obj, indent) {
+ var deep = arguments[2]
+ if (!indent) indent = " "
+
+ // take out the easy ones.
+ switch (typeof obj) {
+ case "string":
+ obj = obj.trim()
+ if (obj.indexOf("\n") !== -1) {
+ return "|\n" + indent + obj.split(/\r?\n/).join("\n"+indent)
+ } else return obj
+
+ case "number":
+ return obj.toString(10)
+
+ case "function":
+ return encode(obj.toString(), indent, true)
+
+ case "boolean":
+ return obj.toString()
+
+ case "undefined":
+ // fallthrough
+ case "object":
+ // at this point we know it types as an object
+ if (!obj) return "~"
+
+ if (obj instanceof Date) return obj.toISOString()
+
+ if (seen.indexOf(obj) !== -1) {
+ return "[Circular]"
+ }
+ seen.push(obj)
+
+ if (typeof Buffer === "function" &&
+ typeof Buffer.isBuffer === "function" &&
+ Buffer.isBuffer(obj)) return obj.inspect()
+
+ if (obj instanceof Error) {
+ var o = { name: obj.name
+ , message: obj.message
+ , type: obj.type }
+
+ if (obj.code) o.code = obj.code
+ if (obj.errno) o.errno = obj.errno
+ if (obj.type) o.type = obj.type
+ obj = o
+ }
+
+ var out = ""
+
+ if (Array.isArray(obj)) {
+ var out = "\n" + indent + "- " +obj.map(function (item) {
+ return encode(item, indent + " ", true)
+ }).join("\n"+indent + "- ")
+ break
+ }
+
+ // an actual object
+ var keys = Object.keys(obj)
+ , niceKeys = keys.map(function (k) {
+ return (k.match(/^[a-zA-Z0-9_]+$/) ? k : JSON.stringify(k)) + ": "
+ })
+ //console.error(keys, niceKeys, obj)
+ var maxLength = Math.max.apply(Math, niceKeys.map(function (k) {
+ return k.length
+ }).concat(0))
+ //console.error(niceKeys, maxLength)
+
+ var spaces = new Array(maxLength + 1).join(" ")
+
+ if (!deep) indent += " "
+ out = "\n" + indent + keys.map(function (k, i) {
+ var niceKey = niceKeys[i]
+ return niceKey + spaces.substr(niceKey.length)
+ + encode(obj[k], indent + " ", true)
+ }).join("\n" + indent)
+ break
+
+ default: return ""
+ }
+ if (!deep) seen.length = 0
+ return out
+}
+
+function decode (str) {
+ var v = str.trim()
+ , d
+ if (v === "~") return null
+ if (v.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}/)
+ && (d = Date.parse(v))) {
+ return new Date(d)
+ }
+ if (v === "true" || v === "false") return JSON.parse(v)
+ if (v && !isNaN(v)) return parseInt(v, 10)
+ // something interesting.
+ var lines = str.split(/\r?\n/)
+ // check if it's some kind of string or something.
+ // if the first line is > or | then it's a wrapping indented string.
+ // if the first line is blank, and there are many lines,
+ // then it's an array or object.
+ // otherwise, it's just ""
+ var first = lines.shift().trim()
+ if (lines.length) lines = undent(lines)
+ switch (first) {
+ case "|":
+ return lines.join("\n")
+ case ">":
+ return lines.join("\n").split(/\n{2,}/).map(function (l) {
+ return l.split(/\n/).join(" ")
+ }).join("\n")
+ default:
+ if (!lines.length) return first
+ // array or object.
+ // the first line will be either "- value" or "key: value"
+ return lines[0].charAt(0) === "-" ? decodeArr(lines) : decodeObj(lines)
+ }
+}
+
+function decodeArr (lines) {
+ var out = []
+ , key = 0
+ , val = []
+ for (var i = 0, l = lines.length; i < l; i ++) {
+ // if it starts with a -, then it's a new thing
+ var line = lines[i]
+ if (line.charAt(0) === "-") {
+ if (val.length) {
+ out[key ++] = decode(val.join("\n"))
+ val.length = 0
+ }
+ val.push(line.substr(1).trim())
+ } else if (line.charAt(0) === " ") {
+ val.push(line)
+ } else return []
+ }
+ if (val.length) {
+ out[key ++] = decode(val.join("\n"))
+ }
+ return out
+}
+
+function decodeObj (lines) {
+ var out = {}
+ , val = []
+ , key = null
+
+ for (var i = 0, l = lines.length; i < l; i ++) {
+ var line = lines[i]
+ if (line.charAt(0) === " ") {
+ val.push(line)
+ continue
+ }
+ // some key:val
+ if (val.length) {
+ out[key] = decode(val.join("\n"))
+ val.length = 0
+ }
+ // parse out the quoted key
+ var first
+ if (line.charAt(0) === "\"") {
+ for (var ii = 1, ll = line.length, esc = false; ii < ll; ii ++) {
+ var c = line.charAt(ii)
+ if (c === "\\") {
+ esc = !esc
+ } else if (c === "\"" && !esc) {
+ break
+ }
+ }
+ key = JSON.parse(line.substr(0, ii + 1))
+ line = line.substr(ii + 1)
+ first = line.substr(line.indexOf(":") + 1).trim()
+ } else {
+ var kv = line.split(":")
+ key = kv.shift()
+ first = kv.join(":").trim()
+ }
+ // now we've set a key, and "first" has the first line of the value.
+ val.push(first.trim())
+ }
+ if (val.length) out[key] = decode(val.join("\n"))
+ return out
+}
+
+function undent (lines) {
+ var i = lines[0].match(/^\s*/)[0].length
+ return lines.map(function (line) {
+ return line.substr(i)
+ })
+}
+
+
+
+if (require.main === module) {
+var obj = [{"bigstring":new Error().stack}
+ ,{ar:[{list:"of"},{some:"objects"}]}
+ ,{date:new Date()}
+ ,{"super huge string":new Error().stack}
+ ]
+
+Date.prototype.toJSON = function (k, val) {
+ console.error(k, val, this)
+ return this.toISOString() + " (it's a date)"
+}
+var enc = encode(obj)
+ , dec = decode(enc)
+ , encDec = encode(dec)
+
+console.error(JSON.stringify({ obj : obj
+ , enc : enc.split(/\n/)
+ , dec : dec }, null, 2), encDec === enc)
+
+var num = 100
+ , encNum = encode(num)
+ , decEncNum = decode(encNum)
+console.error([num, encNum, decEncNum])
+}
View
12 node_modules/tap-producer/package.json
@@ -0,0 +1,12 @@
+{ "name" : "tap-producer"
+, "version" : "0.0.1"
+, "description" : "A module for producing TAP output"
+, "main" : "./tap-producer.js"
+, "author" : "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)"
+, "repository" : "https://github.com/isaacs/tap-producer"
+, "dependencies" :
+ { "inherits" : "*"
+ , "tap-results" : "0.x"
+ , "yamlish" : "*"
+ }
+}
View
113 node_modules/tap-producer/tap-producer.js
@@ -0,0 +1,113 @@
+module.exports = TapProducer
+
+var Results = require("tap-results")
+ , inherits = require("inherits")
+ , yamlish = require("yamlish")
+
+TapProducer.encode = function (result, diag) {
+ var tp = new TapProducer(diag)
+ , out = ""
+ tp.on("data", function (c) { out += c })
+ if (Array.isArray(result)) {
+ result.forEach(tp.write, tp)
+ } else tp.write(result)
+ tp.end()
+ return out
+}
+
+inherits(TapProducer, require("stream").Stream)
+function TapProducer (diag) {
+ TapProducer.super.call(this)
+ this.diag = diag
+ this.count = 0
+ this.readable = this.writable = true
+ this.results = new Results
+}
+
+TapProducer.prototype.trailer = true
+
+TapProducer.prototype.write = function (res) {
+ // console.error("TapProducer.write", res)
+ if (typeof res === "function") throw new Error("wtf?")
+ if (!this.writable) this.emit("error", new Error("not writable"))
+
+ var diag = res.diag
+ if (diag === undefined) diag = this.diag
+
+ this.emit("data", encodeResult(res, this.count + 1, diag))
+
+ if (typeof res === "string") return true
+
+ this.results.add(res, false)
+ this.count ++
+}
+
+TapProducer.prototype.end = function (res) {
+ if (res) this.write(res)
+ this.emit("data", "\n1.."+this.results.testsTotal+"\n")
+ if (this.trailer && typeof this.trailer !== "string") {
+ // summary trailer.
+ var trailer = "tests "+this.results.testsTotal + "\n"
+ if (this.results.pass) {
+ trailer += "pass " + this.results.pass + "\n"
+ }
+ if (this.results.fail) {
+ trailer += "fail " + this.results.fail + "\n"
+ }
+ if (this.results.skip) {
+ trailer += "skip "+this.results.skip + "\n"
+ }
+ if (this.results.todo) {
+ trailer += "todo "+this.results.todo + "\n"
+ }
+ if (this.results.bailedOut) {
+ trailer += "bailed out" + "\n"
+ }
+
+ if (this.results.testsTotal === this.results.pass) {
+ trailer += "\nok\n"
+ }
+ this.trailer = trailer
+ }
+ if (this.trailer) this.write(this.trailer)
+ this.writable = false
+ this.emit("end", null, this.count, this.ok)
+}
+
+function encodeResult (res, count, diag) {
+ if (typeof res === "string") {
+ res = res.split(/\r?\n/).map(function (l) {
+ if (!l.trim()) return l.trim()
+ return "# " + l
+ }).join("\n")
+ if (res.substr(-1) !== "\n") res += "\n"
+ return res
+ }
+
+ if (!!process.env.TAP_NODIAG) diag = false
+ else if (!!process.env.TAP_DIAG) diag = true
+ else if (diag === undefined) diag = !res.ok
+
+ var output = ""
+ res.name = res.name && res.name.trim()
+ output += ( !res.ok ? "not " : "") + "ok " + count
+ + ( !res.name ? ""
+ : " " + res.name.replace(/[\r\n]/, " ") )
+ + ( res.skip ? " # SKIP"
+ : res.todo ? " # TODO"
+ : "" )
+ + "\n"
+
+ if (!diag) return output
+ var d = {}
+ , dc = 0
+ Object.keys(res).filter(function (k) {
+ return k !== "ok" && k !== "name" && k !== "id"
+ }).forEach(function (k) {
+ dc ++
+ d[k] = res[k]
+ })
+ //console.error(d, "about to encode")
+ if (dc > 0) output += " ---"+yamlish.encode(d)+"\n ...\n"
+ return output
+}
View
4 node_modules/uglify-js/.gitignore
@@ -0,0 +1,4 @@
+.DS_Store
+.tmp*~
+*.local.*
+.pinf-*
View
1,026 node_modules/uglify-js/README.html
@@ -0,0 +1,1026 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+lang="en" xml:lang="en">
+<head>
+<title>UglifyJS -- a JavaScript parser/compressor/beautifier</title>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
+<meta name="generator" content="Org-mode"/>
+<meta name="generated" content="2011-08-29 19:17:55 EEST"/>
+<meta name="author" content="Mihai Bazon"/>
+<meta name="description" content="a JavaScript parser/compressor/beautifier in JavaScript"/>
+<meta name="keywords" content="javascript, js, parser, compiler, compressor, mangle, minify, minifier"/>
+<style type="text/css">
+ <!--/*--><![CDATA[/*><!--*/
+ html { font-family: Times, serif; font-size: 12pt; }
+ .title { text-align: center; }
+ .todo { color: red; }
+ .done { color: green; }
+ .tag { background-color: #add8e6; font-weight:normal }
+ .target { }
+ .timestamp { color: #bebebe; }
+ .timestamp-kwd { color: #5f9ea0; }
+ p.verse { margin-left: 3% }
+ pre {
+ border: 1pt solid #AEBDCC;
+ background-color: #F3F5F7;
+ padding: 5pt;
+ font-family: courier, monospace;
+ font-size: 90%;
+ overflow:auto;
+ }
+ table { border-collapse: collapse; }
+ td, th { vertical-align: top; }
+ dt { font-weight: bold; }
+ div.figure { padding: 0.5em; }
+ div.figure p { text-align: center; }
+ textarea { overflow-x: auto; }
+ .linenr { font-size:smaller }
+ .code-highlighted {background-color:#ffff00;}
+ .org-info-js_info-navigation { border-style:none; }
+ #org-info-js_console-label { font-size:10px; font-weight:bold;
+ white-space:nowrap; }
+ .org-info-js_search-highlight {background-color:#ffff00; color:#000000;
+ font-weight:bold; }
+ /*]]>*/-->
+</style>
+<link rel="stylesheet" type="text/css" href="docstyle.css" />
+<script type="text/javascript">
+<!--/*--><![CDATA[/*><!--*/
+ function CodeHighlightOn(elem, id)
+ {
+ var target = document.getElementById(id);
+ if(null != target) {
+ elem.cacheClassElem = elem.className;
+ elem.cacheClassTarget = target.className;
+ target.className = "code-highlighted";
+ elem.className = "code-highlighted";
+ }
+ }
+ function CodeHighlightOff(elem, id)
+ {
+ var target = document.getElementById(id);
+ if(elem.cacheClassElem)
+ elem.className = elem.cacheClassElem;
+ if(elem.cacheClassTarget)
+ target.className = elem.cacheClassTarget;
+ }
+/*]]>*///-->
+</script>
+
+</head>
+<body>
+<div id="content">
+
+<h1 class="title">UglifyJS &ndash; a JavaScript parser/compressor/beautifier</h1>
+
+
+<div id="table-of-contents">
+<h2>Table of Contents</h2>
+<div id="text-table-of-contents">
+<ul>
+<li><a href="#sec-1">1 UglifyJS &mdash; a JavaScript parser/compressor/beautifier </a>
+<ul>
+<li><a href="#sec-1_1">1.1 Unsafe transformations </a>
+<ul>
+<li><a href="#sec-1_1_1">1.1.1 Calls involving the global Array constructor </a></li>
+<li><a href="#sec-1_1_2">1.1.2 <code>obj.toString()</code> ==&gt; <code>obj+“”</code> </a></li>
+</ul>
+</li>
+<li><a href="#sec-1_2">1.2 Install (NPM) </a></li>
+<li><a href="#sec-1_3">1.3 Install latest code from GitHub </a></li>
+<li><a href="#sec-1_4">1.4 Usage </a>
+<ul>
+<li><a href="#sec-1_4_1">1.4.1 API </a></li>
+<li><a href="#sec-1_4_2">1.4.2 Beautifier shortcoming &ndash; no more comments </a></li>
+<li><a href="#sec-1_4_3">1.4.3 Use as a code pre-processor </a></li>
+</ul>
+</li>
+<li><a href="#sec-1_5">1.5 Compression &ndash; how good is it? </a></li>
+<li><a href="#sec-1_6">1.6 Bugs? </a></li>
+<li><a href="#sec-1_7">1.7 Links </a></li>
+<li><a href="#sec-1_8">1.8 License </a></li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+
+<div id="outline-container-1" class="outline-2">
+<h2 id="sec-1"><span class="section-number-2">1</span> UglifyJS &mdash; a JavaScript parser/compressor/beautifier </h2>
+<div class="outline-text-2" id="text-1">
+
+
+<p>
+This package implements a general-purpose JavaScript
+parser/compressor/beautifier toolkit. It is developed on <a href="http://nodejs.org/">NodeJS</a>, but it
+should work on any JavaScript platform supporting the CommonJS module system
+(and if your platform of choice doesn't support CommonJS, you can easily
+implement it, or discard the <code>exports.*</code> lines from UglifyJS sources).
+</p>
+<p>
+The tokenizer/parser generates an abstract syntax tree from JS code. You
+can then traverse the AST to learn more about the code, or do various
+manipulations on it. This part is implemented in <a href="../lib/parse-js.js">parse-js.js</a> and it's a
+port 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>.
+</p>
+<p>
+( See <a href="http://github.com/mishoo/cl-uglify-js">cl-uglify-js</a> if you're looking for the Common Lisp version of
+UglifyJS. )
+</p>
+<p>
+The second part of this package, implemented in <a href="../lib/process.js">process.js</a>, inspects and
+manipulates the AST generated by the parser to provide the following:
+</p>
+<ul>
+<li>
+ability to re-generate JavaScript code from the AST. Optionally
+indented&mdash;you can use this if you want to “beautify” a program that has
+been compressed, so that you can inspect the source. But you can also run
+our code generator to print out an AST without any whitespace, so you
+achieve compression as well.
+
+</li>
+<li>
+shorten variable names (usually to single characters). Our mangler will
+analyze the code and generate proper variable names, depending on scope
+and usage, and is smart enough to deal with globals defined elsewhere, or
+with <code>eval()</code> calls or <code>with{}</code> statements. In short, if <code>eval()</code> or
+<code>with{}</code> are used in some scope, then all variables in that scope and any
+variables in the parent scopes will remain unmangled, and any references
+to such variables remain unmangled as well.
+
+</li>
+<li>
+various small optimizations that may lead to faster code but certainly
+lead to smaller code. Where possible, we do the following:
+
+<ul>
+<li>
+foo["bar"] ==&gt; foo.bar
+
+</li>
+<li>
+remove block brackets <code>{}</code>
+
+</li>
+<li>
+join consecutive var declarations:
+var a = 10; var b = 20; ==&gt; var a=10,b=20;
+
+</li>
+<li>
+resolve simple constant expressions: 1 +2 * 3 ==&gt; 7. We only do the
+replacement if the result occupies less bytes; for example 1/3 would
+translate to 0.333333333333, so in this case we don't replace it.
+
+</li>
+<li>
+consecutive statements in blocks are merged into a sequence; in many
+cases, this leaves blocks with a single statement, so then we can remove
+the block brackets.
+
+</li>
+<li>
+various optimizations for IF statements:
+
+<ul>
+<li>
+if (foo) bar(); else baz(); ==&gt; foo?bar():baz();
+</li>
+<li>
+if (!foo) bar(); else baz(); ==&gt; foo?baz():bar();
+</li>
+<li>
+if (foo) bar(); ==&gt; foo&amp;&amp;bar();
+</li>
+<li>
+if (!foo) bar(); ==&gt; foo||bar();
+</li>
+<li>
+if (foo) return bar(); else return baz(); ==&gt; return foo?bar():baz();
+</li>
+<li>
+if (foo) return bar(); else something(); ==&gt; {if(foo)return bar();something()}
+
+</li>
+</ul>
+</li>
+<li>
+remove some unreachable code and warn about it (code that follows a
+<code>return</code>, <code>throw</code>, <code>break</code> or <code>continue</code> statement, except
+function/variable declarations).
+
+</li>
+<li>
+act a limited version of a pre-processor (c.f. the pre-processor of
+C/C++) to allow you to safely replace selected global symbols with
+specified values. When combined with the optimisations above this can
+make UglifyJS operate slightly more like a compilation process, in
+that when certain symbols are replaced by constant values, entire code
+blocks may be optimised away as unreachable.
+</li>
+</ul>
+</li>
+</ul>
+
+
+
+</div>
+
+<div id="outline-container-1_1" class="outline-3">
+<h3 id="sec-1_1"><span class="section-number-3">1.1</span> <span class="target">Unsafe transformations</span> </h3>
+<div class="outline-text-3" id="text-1_1">
+
+
+<p>
+The following transformations can in theory break code, although they're
+probably safe in most practical cases. To enable them you need to pass the
+<code>--unsafe</code> flag.
+</p>
+
+</div>
+
+<div id="outline-container-1_1_1" class="outline-4">
+<h4 id="sec-1_1_1"><span class="section-number-4">1.1.1</span> Calls involving the global Array constructor </h4>
+<div class="outline-text-4" id="text-1_1_1">
+
+
+<p>
+The following transformations occur:
+</p>
+
+
+
+<pre class="src src-js"><span style="color: #a020f0;">new</span> <span style="color: #228b22;">Array</span>(1, 2, 3, 4) =&gt; [1,2,3,4]
+Array(a, b, c) =&gt; [a,b,c]
+<span style="color: #a020f0;">new</span> <span style="color: #228b22;">Array</span>(5) =&gt; Array(5)
+<span style="color: #a020f0;">new</span> <span style="color: #228b22;">Array</span>(a) =&gt; Array(a)
+</pre>
+
+
+
+<p>
+These are all safe if the Array name isn't redefined. JavaScript does allow
+one to globally redefine Array (and pretty much everything, in fact) but I
+personally don't see why would anyone do that.
+</p>
+<p>
+UglifyJS does handle the case where Array is redefined locally, or even
+globally but with a <code>function</code> or <code>var</code> declaration. Therefore, in the
+following cases UglifyJS <b>doesn't touch</b> calls or instantiations of Array:
+</p>
+
+
+
+<pre class="src src-js"><span style="color: #b22222;">// </span><span style="color: #b22222;">case 1. globally declared variable
+</span> <span style="color: #a020f0;">var</span> <span style="color: #b8860b;">Array</span>;
+ <span style="color: #a020f0;">new</span> <span style="color: #228b22;">Array</span>(1, 2, 3);
+ Array(a, b);
+
+ <span style="color: #b22222;">// </span><span style="color: #b22222;">or (can be declared later)
+</span> <span style="color: #a020f0;">new</span> <span style="color: #228b22;">Array</span>(1, 2, 3);
+ <span style="color: #a020f0;">var</span> <span style="color: #b8860b;">Array</span>;
+
+ <span style="color: #b22222;">// </span><span style="color: #b22222;">or (can be a function)
+</span> <span style="color: #a020f0;">new</span> <span style="color: #228b22;">Array</span>(1, 2, 3);
+ <span style="color: #a020f0;">function</span> <span style="color: #0000ff;">Array</span>() { ... }
+
+<span