|
@@ -8,11 +8,11 @@
|
|
|
* @constructor
|
|
* @constructor
|
|
|
**/
|
|
**/
|
|
|
var MinMaxAccumulator = module.exports = function MinMaxAccumulator(theSense){
|
|
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
|
|
this._sense = theSense; // 1 for min, -1 for max; used to "scale" comparison
|
|
|
base.call(this);
|
|
base.call(this);
|
|
|
if (this._sense !== 1 && this._sense !== -1) throw new Error("Assertion failure");
|
|
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");
|
|
var Value = require("../Value");
|
|
|
|
|
|
|
@@ -44,6 +44,6 @@ klass.createMax = function createMax(){
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
proto.getOpName = function getOpName() {
|
|
proto.getOpName = function getOpName() {
|
|
|
- if (this._sense == 1) return "$min";
|
|
|
|
|
|
|
+ if (this._sense === 1) return "$min";
|
|
|
return "$max";
|
|
return "$max";
|
|
|
};
|
|
};
|