coffee-coverage
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
// Generated by CoffeeScript 1.12.4 | ||
(function() { | ||
@@ -249,3 +249,3 @@ var CoverageError, EXTENSIONS, INSTRUMENTORS, NodeWrapper, SkipVisitor, _, assert, coffeeScript, events, excludeFile, factoryDefaults, fs, getInstrumentorClass, mkdirs, path, ref, statFile, util, | ||
exports._runInstrumentor = function(instrumentor, fileName, source, options) { | ||
var answer, ast, coffeeOptions, err, error, error1, init, js, ref1, ref2, runVisitor, token, tokens, wrappedAST; | ||
var answer, ast, coffeeOptions, err, init, js, ref1, ref2, runVisitor, token, tokens, wrappedAST; | ||
if (options == null) { | ||
@@ -266,3 +266,3 @@ options = {}; | ||
tokens = coffeeScript.tokens(source, coffeeOptions); | ||
coffeeOptions.referencedVars = (function() { | ||
coffeeOptions.referencedVars = _.uniq((function() { | ||
var j, len, results; | ||
@@ -272,3 +272,3 @@ results = []; | ||
token = tokens[j]; | ||
if (token.variable) { | ||
if (token[0] === 'IDENTIFIER') { | ||
results.push(token[1]); | ||
@@ -278,3 +278,3 @@ } | ||
return results; | ||
})(); | ||
})()); | ||
ast = coffeeScript.nodes(tokens); | ||
@@ -285,41 +285,39 @@ } catch (error) { | ||
} | ||
runVisitor = (function(_this) { | ||
return function(visitor, nodeWrapper) { | ||
var __, i, indent, j, len, name, ref3, ref4, ref5; | ||
if ((ref3 = nodeWrapper.node.coffeeCoverage) != null ? ref3.generated : void 0) { | ||
return; | ||
} | ||
if (((ref4 = options.log) != null ? ref4.debug : void 0) != null) { | ||
indent = ((function() { | ||
var j, ref5, results; | ||
results = []; | ||
for (i = j = 0, ref5 = nodeWrapper.depth; 0 <= ref5 ? j < ref5 : j > ref5; i = 0 <= ref5 ? ++j : --j) { | ||
results.push(" "); | ||
} | ||
return results; | ||
})()).join(''); | ||
options.log.debug(indent + "Examining " + (nodeWrapper.toString())); | ||
} | ||
if (nodeWrapper.isStatement) { | ||
if (typeof visitor["visitStatement"] === "function") { | ||
visitor["visitStatement"](nodeWrapper); | ||
runVisitor = function(visitor, nodeWrapper) { | ||
var __, i, indent, j, len, name, ref3, ref4, ref5; | ||
if ((ref3 = nodeWrapper.node.coffeeCoverage) != null ? ref3.generated : void 0) { | ||
return; | ||
} | ||
if (((ref4 = options.log) != null ? ref4.debug : void 0) != null) { | ||
indent = ((function() { | ||
var j, ref5, results; | ||
results = []; | ||
for (i = j = 0, ref5 = nodeWrapper.depth; 0 <= ref5 ? j < ref5 : j > ref5; i = 0 <= ref5 ? ++j : --j) { | ||
results.push(" "); | ||
} | ||
return results; | ||
})()).join(''); | ||
options.log.debug(indent + "Examining " + (nodeWrapper.toString())); | ||
} | ||
if (nodeWrapper.isStatement) { | ||
if (typeof visitor["visitStatement"] === "function") { | ||
visitor["visitStatement"](nodeWrapper); | ||
} | ||
if (typeof visitor[name = "visit" + nodeWrapper.type] === "function") { | ||
visitor[name](nodeWrapper); | ||
} | ||
if (typeof visitor[name = "visit" + nodeWrapper.type] === "function") { | ||
visitor[name](nodeWrapper); | ||
} | ||
if (nodeWrapper.isSwitchCases) { | ||
ref5 = nodeWrapper.node; | ||
for (i = j = 0, len = ref5.length; j < len; i = ++j) { | ||
__ = ref5[i]; | ||
nodeWrapper.forEachChildOfType(i, function(child) { | ||
return runVisitor(visitor, child); | ||
}); | ||
} | ||
if (nodeWrapper.isSwitchCases) { | ||
ref5 = nodeWrapper.node; | ||
for (i = j = 0, len = ref5.length; j < len; i = ++j) { | ||
__ = ref5[i]; | ||
nodeWrapper.forEachChildOfType(i, function(child) { | ||
return runVisitor(visitor, child); | ||
}); | ||
} | ||
} | ||
return nodeWrapper.forEachChild(function(child) { | ||
return runVisitor(visitor, child); | ||
}); | ||
}; | ||
})(this); | ||
} | ||
return nodeWrapper.forEachChild(function(child) { | ||
return runVisitor(visitor, child); | ||
}); | ||
}; | ||
wrappedAST = new NodeWrapper(ast); | ||
@@ -331,4 +329,4 @@ runVisitor(new SkipVisitor(fileName), wrappedAST); | ||
js = ast.compile(coffeeOptions); | ||
} catch (error1) { | ||
err = error1; | ||
} catch (error) { | ||
err = error; | ||
@@ -335,0 +333,0 @@ /* !pragma coverage-skip-block */ |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
// Generated by CoffeeScript 1.12.4 | ||
(function() { | ||
@@ -96,3 +96,3 @@ var CoverageInstrumentor, DEFAULT_INSTRUMENTOR, INSTRUMENTORS, _, executableName, fs, mkdirs, parseArgs, path, ref, ref1, stripLeadingDotOrSlash, version; | ||
exports.main = function(args) { | ||
var coverageInstrumentor, err, error, options, ref2, result; | ||
var coverageInstrumentor, err, options, ref2, result; | ||
try { | ||
@@ -99,0 +99,0 @@ options = parseArgs(args.slice(2)); |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
// Generated by CoffeeScript 1.12.4 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var CompiledCache, EXTENSIONS, _, fs, getRelativeFilename, mkdirs, path, ref; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
// Generated by CoffeeScript 1.12.4 | ||
(function() { | ||
@@ -3,0 +3,0 @@ exports.EXTENSIONS = { |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
// Generated by CoffeeScript 1.12.4 | ||
(function() { | ||
@@ -3,0 +3,0 @@ exports.register = require('./register'); |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
// Generated by CoffeeScript 1.12.4 | ||
(function() { | ||
@@ -359,3 +359,3 @@ var Istanbul, NodeWrapper, _, assert, compareLocations, fileToLines, findInCode, minLocation, nodeToLocation, ref, toQuotedString; | ||
this.fnMap.push({ | ||
name: (ref1 = node.node.determineName()) != null ? ref1 : '(anonymousClass)', | ||
name: (ref1 = node.node.determineName()) != null ? ref1 : '_Class', | ||
line: loc.start.line, | ||
@@ -362,0 +362,0 @@ loc: nodeToLocation(node), |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
// Generated by CoffeeScript 1.12.4 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var JSCoverage, _, fileToLines, generateUniqueName, getRelativeFilename, path, ref, stripLeadingDotOrSlash, toQuotedString, |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
// Generated by CoffeeScript 1.12.4 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var NodeWrapper, _, assert, coffeeScript, compile, forNodeAndChildren; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
// Generated by CoffeeScript 1.12.4 | ||
(function() { | ||
@@ -31,3 +31,3 @@ var CompiledCache, StringStream, _, coffeeCoverage, excludeFile, fs, getRelativeFilename, mkdirs, path, ref; | ||
module.exports = function(options) { | ||
var compiledCache, coverage, defaults, err, error, instrumentFile, instrumentorClass, module, origStreamineCoffeeHandler, replaceHandler, streamlineTransform; | ||
var compiledCache, coverage, defaults, err, instrumentFile, instrumentorClass, module, origStreamineCoffeeHandler, replaceHandler, streamlineTransform; | ||
if (options == null) { | ||
@@ -148,3 +148,3 @@ options = {}; | ||
return process.on('exit', function() { | ||
var dirName, error1, ref1; | ||
var dirName, ref1; | ||
try { | ||
@@ -154,4 +154,4 @@ dirName = path.dirname(options.writeOnExit); | ||
return fs.writeFileSync(options.writeOnExit, JSON.stringify(global[options.coverageVar])); | ||
} catch (error1) { | ||
err = error1; | ||
} catch (error) { | ||
err = error; | ||
return console.error("Failed to write coverage data", (ref1 = err.stack) != null ? ref1 : err); | ||
@@ -158,0 +158,0 @@ } |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
// Generated by CoffeeScript 1.12.4 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var NodeWrapper, PRAGMAS, PRAGMA_PREFIX, SkipVisitor, _; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
// Generated by CoffeeScript 1.12.4 | ||
(function() { | ||
@@ -3,0 +3,0 @@ exports.fileToLines = function(source) { |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.10.0 | ||
// Generated by CoffeeScript 1.12.4 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var EXTENSIONS, _, assert, fs, minimatch, path, statFile, |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"author": "Benbria (http://www.benbria.com/)", | ||
@@ -48,9 +48,8 @@ "contributors": [ | ||
"devDependencies": { | ||
"benchmark": "^2.0.0", | ||
"chai": "^3.0.0", | ||
"coveralls": "^2.11.2", | ||
"istanbul": "^0.4.4", | ||
"mocha": "^2.1.0", | ||
"sinon": "^1.14.1", | ||
"benchmark": "^2.0.0", | ||
"streamline": "0.12.1" | ||
"mocha": "^3.2.0", | ||
"sinon": "^1.14.1" | ||
}, | ||
@@ -57,0 +56,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
6
113638
1881