From d3cff9082fbeaef3af315b797a65cb7952cc161f Mon Sep 17 00:00:00 2001 From: Andreas Lubbe Date: Sun, 13 Sep 2015 12:27:07 +0200 Subject: [PATCH] Remove uncaught error vars --- lib/coffee-script/cake.js | 2 +- lib/coffee-script/coffee-script.js | 4 ++-- lib/coffee-script/command.js | 23 +++++++++++------------ lib/coffee-script/repl.js | 2 +- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/coffee-script/cake.js b/lib/coffee-script/cake.js index fe227b52..bc5ea6fe 100644 --- a/lib/coffee-script/cake.js +++ b/lib/coffee-script/cake.js @@ -46,7 +46,7 @@ }); exports.run = function() { - var arg, args, e, error, i, len, ref, results; + var arg, args, e, i, len, ref, results; global.__originalDirname = fs.realpathSync('.'); process.chdir(cakefileDirectory(__originalDirname)); args = process.argv.slice(2); diff --git a/lib/coffee-script/coffee-script.js b/lib/coffee-script/coffee-script.js index 1a30d49c..8fe95392 100644 --- a/lib/coffee-script/coffee-script.js +++ b/lib/coffee-script/coffee-script.js @@ -26,7 +26,7 @@ withPrettyErrors = function(fn) { return function(code, options) { - var err, error; + var err; if (options == null) { options = {}; } @@ -217,7 +217,7 @@ } exports._compileFile = function(filename, sourceMap) { - var answer, err, error, raw, stripped; + var answer, err, raw, stripped; if (sourceMap == null) { sourceMap = false; } diff --git a/lib/coffee-script/command.js b/lib/coffee-script/command.js index 623c37ce..851102a5 100644 --- a/lib/coffee-script/command.js +++ b/lib/coffee-script/command.js @@ -112,7 +112,7 @@ }; compilePath = function(source, topLevel, base) { - var code, err, error, error1, error2, file, files, i, len, results, stats; + var code, err, file, files, i, len, results, stats; if (indexOf.call(sources, source) >= 0 || watchedDirs[source] || !topLevel && (notSources[source] || hidden(source))) { return; } @@ -140,8 +140,8 @@ } try { files = fs.readdirSync(source); - } catch (error1) { - err = error1; + } catch (error) { + err = error; if (err.code === 'ENOENT') { return; } else { @@ -163,8 +163,8 @@ } try { code = fs.readFileSync(source); - } catch (error2) { - err = error2; + } catch (error) { + err = error; if (err.code === 'ENOENT') { return; } else { @@ -178,7 +178,7 @@ }; findDirectoryIndex = function(source) { - var err, error, ext, i, index, len, ref1; + var err, ext, i, index, len, ref1; ref1 = CoffeeScript.FILE_EXTENSIONS; for (i = 0, len = ref1.length; i < len; i++) { ext = ref1[i]; @@ -199,7 +199,7 @@ }; compileScript = function(file, input, base) { - var compiled, err, error, message, o, options, t, task; + var compiled, err, message, o, options, t, task; if (base == null) { base = null; } @@ -289,12 +289,11 @@ }; watch = function(source, base) { - var compile, compileTimeout, err, error, prevStats, rewatch, startWatcher, watchErr, watcher; + var compile, compileTimeout, err, prevStats, rewatch, startWatcher, watchErr, watcher; watcher = null; prevStats = null; compileTimeout = null; watchErr = function(err) { - var error; if (err.code !== 'ENOENT') { throw err; } @@ -353,7 +352,7 @@ }; watchDir = function(source, base) { - var err, error, readdirTimeout, startWatcher, stopWatcher, watcher; + var err, readdirTimeout, startWatcher, stopWatcher, watcher; watcher = null; readdirTimeout = null; startWatcher = function() { @@ -365,7 +364,7 @@ }).on('change', function() { clearTimeout(readdirTimeout); return readdirTimeout = wait(25, function() { - var err, error, file, files, i, len, results; + var err, file, files, i, len, results; try { files = fs.readdirSync(source); } catch (error) { @@ -429,7 +428,7 @@ }; silentUnlink = function(path) { - var err, error, ref1; + var err, ref1; try { return fs.unlinkSync(path); } catch (error) { diff --git a/lib/coffee-script/repl.js b/lib/coffee-script/repl.js index f4aa4ef2..e4dcfe73 100644 --- a/lib/coffee-script/repl.js +++ b/lib/coffee-script/repl.js @@ -19,7 +19,7 @@ historyFile: process.env.HOME ? path.join(process.env.HOME, '.coffee_history') : void 0, historyMaxInputSize: 10240, "eval": function(input, context, filename, cb) { - var Assign, Block, Literal, Value, ast, err, error, js, ref1, referencedVars, token, tokens; + var Assign, Block, Literal, Value, ast, err, js, ref1, referencedVars, token, tokens; input = input.replace(/\uFF00/g, '\n'); input = input.replace(/^\(([\s\S]*)\n\)$/m, '$1'); ref1 = require('./nodes'), Block = ref1.Block, Assign = ref1.Assign, Value = ref1.Value, Literal = ref1.Literal;