Просмотр исходного кода

EAGLESIX-3157: accumulators: fix jshint

Kyle P Davis 11 лет назад
Родитель
Сommit
b1b425a2bd

+ 1 - 1
lib/pipeline/accumulators/Accumulator.js

@@ -10,7 +10,7 @@
 var Accumulator = module.exports = function Accumulator(){
 	if (arguments.length !== 0) throw new Error("zero args expected");
 	base.call(this);
-}, klass = Accumulator, base = Object, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
+}, klass = Accumulator, base = Object, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}}); //jshint ignore:line
 
 /** Process input and update internal state.
  *  merging should be true when processing outputs from getValue(true).

+ 1 - 1
lib/pipeline/accumulators/AddToSetAccumulator.js

@@ -11,7 +11,7 @@ var AddToSetAccumulator = module.exports = function AddToSetAccumulator() {
 	if (arguments.length !== 0) throw new Error("zero args expected");
 	this.reset();
 	base.call(this);
-}, klass = AddToSetAccumulator, Accumulator = require("./Accumulator"), base = Accumulator, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
+}, klass = AddToSetAccumulator, base = require("./Accumulator"), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}}); //jshint ignore:line
 
 var ValueSet = require("../ValueSet");
 

+ 4 - 6
lib/pipeline/accumulators/AvgAccumulator.js

@@ -10,17 +10,15 @@
 var AvgAccumulator = module.exports = function AvgAccumulator(){
 	this.reset();
 	base.call(this);
-}, klass = AvgAccumulator, Accumulator = require("./Accumulator"), base = Accumulator, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
+}, klass = AvgAccumulator, base = require("./Accumulator"), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}}); //jshint ignore:line
 
-var Value = require("../Value");
-
-var SUB_TOTAL_NAME = "subTotal";
-var COUNT_NAME = "count";
+var SUB_TOTAL_NAME = "subTotal",
+	COUNT_NAME = "count";
 
 proto.processInternal = function processInternal(input, merging) {
 	if (!merging) {
 		// non numeric types have no impact on average
-		if (typeof input != "number") return;
+		if (typeof input !== "number") return;
 
 		this._total += input;
 		this._count += 1;

+ 1 - 1
lib/pipeline/accumulators/FirstAccumulator.js

@@ -11,7 +11,7 @@ var FirstAccumulator = module.exports = function FirstAccumulator(){
 	if (arguments.length !== 0) throw new Error("zero args expected");
 	this.reset();
 	base.call(this);
-}, klass = FirstAccumulator, base = require("./Accumulator"), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
+}, klass = FirstAccumulator, base = require("./Accumulator"), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}}); //jshint ignore:line
 
 proto.processInternal = function processInternal(input, merging) {
 	// only remember the first value seen

+ 1 - 1
lib/pipeline/accumulators/LastAccumulator.js

@@ -11,7 +11,7 @@ var LastAccumulator = module.exports = function LastAccumulator(){
 	if (arguments.length !== 0) throw new Error("zero args expected");
 	this.reset();
 	base.call(this);
-}, klass = LastAccumulator, base = require("./Accumulator"), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
+}, klass = LastAccumulator, base = require("./Accumulator"), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}}); //jshint ignore:line
 
 proto.processInternal = function processInternal(input, merging) {
 	// always remember the last value seen

+ 3 - 3
lib/pipeline/accumulators/MinMaxAccumulator.js

@@ -8,11 +8,11 @@
  * @constructor
  **/
 var MinMaxAccumulator = module.exports = function MinMaxAccumulator(theSense){
-	if (arguments.length != 1) throw new Error("expects a single value");
+	if (arguments.length !== 1) throw new Error("expects a single value");
 	this._sense = theSense; // 1 for min, -1 for max; used to "scale" comparison
 	base.call(this);
 	if (this._sense !== 1 && this._sense !== -1) throw new Error("Assertion failure");
-}, klass = MinMaxAccumulator, base = require("./Accumulator"), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
+}, klass = MinMaxAccumulator, base = require("./Accumulator"), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}}); //jshint ignore:line
 
 var Value = require("../Value");
 
@@ -44,6 +44,6 @@ klass.createMax = function createMax(){
 };
 
 proto.getOpName = function getOpName() {
-	if (this._sense == 1) return "$min";
+	if (this._sense === 1) return "$min";
 	return "$max";
 };

+ 1 - 1
lib/pipeline/accumulators/PushAccumulator.js

@@ -11,7 +11,7 @@ var PushAccumulator = module.exports = function PushAccumulator(){
 	if (arguments.length !== 0) throw new Error("zero args expected");
 	this.values = [];
 	base.call(this);
-}, klass = PushAccumulator, Accumulator = require("./Accumulator"), base = Accumulator, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
+}, klass = PushAccumulator, base = require("./Accumulator"), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}}); //jshint ignore:line
 
 proto.processInternal = function processInternal(input, merging) {
 	if (!merging) {

+ 1 - 1
lib/pipeline/accumulators/SumAccumulator.js

@@ -11,7 +11,7 @@ var SumAccumulator = module.exports = function SumAccumulator() {
 	if (arguments.length !== 0) throw new Error("zero args expected");
 	this.reset();
 	base.call(this);
-}, klass = SumAccumulator, base = require("./Accumulator"), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
+}, klass = SumAccumulator, base = require("./Accumulator"), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}}); //jshint ignore:line
 
 proto.processInternal = function processInternal(input, merging) {
 	// do nothing with non numeric types