Code coverage report for lib\CriticalDependenciesWarning.js

Statements: 100% (17 / 17)      Branches: 62.5% (5 / 8)      Functions: 100% (3 / 3)      Lines: 100% (15 / 15)      Ignored: none     

All files » lib\ » CriticalDependenciesWarning.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25        1 52 52 52 52 52 52   52 52   52 52   52 52   1   1  
/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
function CriticalDependenciesWarning(module, dependencies) {
	Error.call(this);
	Error.captureStackTrace(this, CriticalDependenciesWarning);
	this.name = "CriticalDependenciesWarning";
	this.message = "Critical dependencies:";
	this.message += dependencies.filter(function(d) {
		return typeof d.critical === "string" || d.loc;
	}).map(function(dep) {
		var line = [];
		Eif(dep.loc) line.push(dep.loc.start.line + ":" + dep.loc.start.column + "-" +
			(dep.loc.start.line !== dep.loc.end.line ? dep.loc.end.line + ":" : "") + dep.loc.end.column);
		Eif(typeof dep.critical === "string") line.push(dep.critical);
		return "\n" + line.join(" ");
	}).join("");
	this.dependencies = dependencies;
	this.origin = this.module = module;
}
module.exports = CriticalDependenciesWarning;
 
CriticalDependenciesWarning.prototype = Object.create(Error.prototype);