diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-10-02 16:40:01 +0300 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-10-02 16:40:01 +0300 |
commit | cb2e811191238eb5adfa3560630770649fe29ec9 (patch) | |
tree | 47a0d386d3816c1c7929a54be218244079084a8f | |
parent | 075f93ec0dd8a86a87632ac1e2b1aac3b115f7c0 (diff) | |
download | tracifyjs-cb2e811191238eb5adfa3560630770649fe29ec9.tar.gz tracifyjs-cb2e811191238eb5adfa3560630770649fe29ec9.zip |
discard annoying nodejs warning
-rw-r--r-- | tools/node.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/node.js b/tools/node.js index 0185d045..3d743640 100644 --- a/tools/node.js +++ b/tools/node.js @@ -1,4 +1,12 @@ +var save_stderr = process.stderr; var fs = require("fs"); + +// discard annoying NodeJS warning ("path.existsSync is now called `fs.existsSync`.") +var devnull = fs.createWriteStream("/dev/null"); +process.__defineGetter__("stderr", function(){ + return devnull; +}); + var vm = require("vm"); var sys = require("util"); var path = require("path"); @@ -10,6 +18,10 @@ var UglifyJS = vm.createContext({ MOZ_SourceMap : require("source-map") }); +process.__defineGetter__("stderr", function(){ + return save_stderr; +}); + function load_global(file) { file = path.resolve(path.dirname(module.filename), file); try { |