From: Mihai Bazon Date: Sun, 27 May 2012 11:36:51 +0000 (+0300) Subject: added small node test script X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=22bb5e8306687fb6324f094d208b564c9e874f77;p=UglifyJS.git added small node test script --- diff --git a/lib/node.js b/lib/node.js new file mode 100755 index 00000000..36bc18a0 --- /dev/null +++ b/lib/node.js @@ -0,0 +1,20 @@ +#! /usr/bin/env node + +var fs = require("fs"); + +function load_global(file) { + var code = fs.readFileSync(file, "utf8"); + return global.eval(code); +}; + +load_global("./utils.js"); +load_global("./ast.js"); +load_global("./parse.js"); + +/// + +var filename = process.argv[2]; +console.time("parse"); +var ast = parse(fs.readFileSync(filename, "utf8")); +console.timeEnd("parse"); +