a zip code crypto-currency system good for red ONLY

node.js 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. var fs = require("fs");
  2. var UglifyJS = exports;
  3. var FILES = UglifyJS.FILES = [
  4. "../lib/utils.js",
  5. "../lib/ast.js",
  6. "../lib/parse.js",
  7. "../lib/transform.js",
  8. "../lib/scope.js",
  9. "../lib/output.js",
  10. "../lib/compress.js",
  11. "../lib/sourcemap.js",
  12. "../lib/mozilla-ast.js",
  13. "../lib/propmangle.js",
  14. "../lib/minify.js",
  15. "./exports.js",
  16. ].map(function(file){
  17. return require.resolve(file);
  18. });
  19. new Function("MOZ_SourceMap", "exports", function() {
  20. var code = FILES.map(function(file) {
  21. return fs.readFileSync(file, "utf8");
  22. });
  23. code.push("exports.describe_ast = " + describe_ast.toString());
  24. return code.join("\n\n");
  25. }())(
  26. require("source-map"),
  27. UglifyJS
  28. );
  29. function describe_ast() {
  30. var out = OutputStream({ beautify: true });
  31. function doitem(ctor) {
  32. out.print("AST_" + ctor.TYPE);
  33. var props = ctor.SELF_PROPS.filter(function(prop){
  34. return !/^\$/.test(prop);
  35. });
  36. if (props.length > 0) {
  37. out.space();
  38. out.with_parens(function(){
  39. props.forEach(function(prop, i){
  40. if (i) out.space();
  41. out.print(prop);
  42. });
  43. });
  44. }
  45. if (ctor.documentation) {
  46. out.space();
  47. out.print_string(ctor.documentation);
  48. }
  49. if (ctor.SUBCLASSES.length > 0) {
  50. out.space();
  51. out.with_block(function(){
  52. ctor.SUBCLASSES.forEach(function(ctor, i){
  53. out.indent();
  54. doitem(ctor);
  55. out.newline();
  56. });
  57. });
  58. }
  59. };
  60. doitem(AST_Node);
  61. return out + "\n";
  62. }
  63. function infer_options(options) {
  64. var result = UglifyJS.minify("", options);
  65. return result.error && result.error.defs;
  66. }
  67. UglifyJS.default_options = function() {
  68. var defs = {};
  69. Object.keys(infer_options({ 0: 0 })).forEach(function(component) {
  70. var options = {};
  71. options[component] = { 0: 0 };
  72. if (options = infer_options(options)) {
  73. defs[component] = options;
  74. }
  75. });
  76. return defs;
  77. };