Selaa lähdekoodia

ref #3359: Fixed JSHint warnings

Brennan Chesley 12 vuotta sitten
vanhempi
commit
6fa21151b7

+ 1 - 1
lib/pipeline/matcher/ArrayFilterEntries.js

@@ -211,7 +211,7 @@ proto.regex = function regex( idx ) { //  int idx
  */
  */
 proto.singleNull = function singleNull( /*  */ ){
 proto.singleNull = function singleNull( /*  */ ){
 // File: expression_leaf.h lines: 255-254
 // File: expression_leaf.h lines: 255-254
-	return this.size() == 1 && _hasNull;
+	return this.size() == 1 && this._hasNull;
 };
 };
 
 
 
 

+ 1 - 1
lib/pipeline/matcher/AtomicMatchExpression.js

@@ -1,4 +1,4 @@
-"use strict"
+"use strict";
 
 
 var MatchExpression = require('./MatchExpression');
 var MatchExpression = require('./MatchExpression');
 
 

+ 4 - 1
lib/pipeline/matcher/ExistsMatchExpression.js

@@ -61,7 +61,10 @@ proto.matchesSingleElement = function matchesSingleElement( e ) { //  const BSON
 // File: expression_leaf.cpp lines: 282-283
 // File: expression_leaf.cpp lines: 282-283
 	if(typeof(e) == 'undefined')
 	if(typeof(e) == 'undefined')
 		return false;
 		return false;
-	return !(typeof(e) == 'object') || Object.keys(e).length > 0;
+	if(typeof(e) == 'object')
+		return (Object.keys(e).length > 0);
+	else
+		return true;
 };
 };
 
 
 
 

+ 1 - 1
lib/pipeline/matcher/FalseMatchExpression.js

@@ -31,7 +31,7 @@ proto.debugString = function debugString( level ) { //  StringBuilder& debug, in
  */
  */
 proto.equivalent = function equivalent( other ) { //  const MatchExpression* other
 proto.equivalent = function equivalent( other ) { //  const MatchExpression* other
 // File: expression.h lines: 222-223
 // File: expression.h lines: 222-223
-	return other._matchType = 'ALWAYS_FALSE';
+	return other._matchType === 'ALWAYS_FALSE';
 };
 };
 
 
 
 

+ 17 - 14
lib/pipeline/matcher/MatchExpressionParser.js

@@ -117,13 +117,14 @@ proto._parse = function _parse(obj, topLevel){
 				*/
 				*/
 
 
 				return {'code':'FAILED_TO_PARSE', 'desc':'Where unimplimented.'};
 				return {'code':'FAILED_TO_PARSE', 'desc':'Where unimplimented.'};
-
+				/*
 				status = this.expressionParserWhereCallback(element);
 				status = this.expressionParserWhereCallback(element);
 				if (status.code != ErrorCodes.OK)
 				if (status.code != ErrorCodes.OK)
 					return status;
 					return status;
-				root.add(status.result);
+				root.add(status.result);*/
 			}
 			}
 			else if ("comment" == rest) {
 			else if ("comment" == rest) {
+				1+1;
 			}
 			}
 			else {
 			else {
 				return {code:ErrorCodes.BAD_VALUE, description:"unknown top level operator: " + currname};
 				return {code:ErrorCodes.BAD_VALUE, description:"unknown top level operator: " + currname};
@@ -198,7 +199,7 @@ proto._parseAll = function _parseAll(name, element){
 				return {code:ErrorCodes.BAD_VALUE, description:"$all/$elemMatch has to be consistent"};
 				return {code:ErrorCodes.BAD_VALUE, description:"$all/$elemMatch has to be consistent"};
 			}
 			}
 
 
-			status = this._parseElemMatch("",  hopefullyElemMatchElement['$elemMatch'] ); // TODO: wrong way to do this?
+			status = this._parseElemMatch("",  hopefullyElemMatchElement.$elemMatch ); // TODO: wrong way to do this?
 			if (status.code != ErrorCodes.OK)
 			if (status.code != ErrorCodes.OK)
 				return status;
 				return status;
 			temp.add(status.result);
 			temp.add(status.result);
@@ -353,12 +354,12 @@ proto._parseMOD = function _parseMOD(name, element){
 		return {code:ErrorCodes.BAD_VALUE, result:"malformed mod, not enough elements"};
 		return {code:ErrorCodes.BAD_VALUE, result:"malformed mod, not enough elements"};
 	if (element.length > 2)
 	if (element.length > 2)
 		return {code:ErrorCodes.BAD_VALUE, result:"malformed mod, too many elements"};
 		return {code:ErrorCodes.BAD_VALUE, result:"malformed mod, too many elements"};
-	if (!(element[0] instanceof Number || typeof(element[0]) == 'number')) {
+	if ((typeof(element[0]) != 'number')) {
 		return {code:ErrorCodes.BAD_VALUE, result:"malformed mod, divisor not a number"};
 		return {code:ErrorCodes.BAD_VALUE, result:"malformed mod, divisor not a number"};
 	} else {
 	} else {
 		d = element[0];
 		d = element[0];
 	}
 	}
-	if (!(element[1] instanceof Number || typeof(element[1]) == 'number')) {
+	if (( typeof(element[1]) != 'number') ) {
 		r = 0;
 		r = 0;
 	} else {
 	} else {
 		r = element[1];
 		r = element[1];
@@ -430,8 +431,8 @@ proto._parseRegexDocument = function _parseRegexDocument(name, doc){
 	// File: expression_parser.cpp lines: 402-442
 	// File: expression_parser.cpp lines: 402-442
 	var regex = '', regexOptions = '', e;
 	var regex = '', regexOptions = '', e;
 	
 	
-	if(doc['$regex']) {
-		e = doc['$regex'];
+	if(doc.$regex) {
+		e = doc.$regex;
 		if(e instanceof RegExp) {
 		if(e instanceof RegExp) {
 			var str = e.toString(),
 			var str = e.toString(),
 				flagIndex = 0;
 				flagIndex = 0;
@@ -443,15 +444,15 @@ proto._parseRegexDocument = function _parseRegexDocument(name, doc){
 			}
 			}
 			regex = (flagIndex? str : str.substr(1, flagIndex-1));
 			regex = (flagIndex? str : str.substr(1, flagIndex-1));
 			regexOptions = str.substr(flagIndex, str.length);
 			regexOptions = str.substr(flagIndex, str.length);
-		} else if (typeof(e) == 'string' || e instanceof String) {
+		} else if (typeof(e) == 'string') {
 			regex = e;
 			regex = e;
 		} else {
 		} else {
 			return {code:ErrorCodes.BAD_VALUE, description:"$regex has to be a string"};
 			return {code:ErrorCodes.BAD_VALUE, description:"$regex has to be a string"};
 		}
 		}
 	}
 	}
 
 
-	if(doc['$options']) {
-		e = doc['$options'];
+	if(doc.$options) {
+		e = doc.$options;
 		if(typeof(e) == 'string') {
 		if(typeof(e) == 'string') {
 			regexOptions = e;
 			regexOptions = e;
 		} else {
 		} else {
@@ -601,10 +602,10 @@ proto._parseSubField = function _parseSubField(context, andSoFar, name, element)
 
 
 	case '$size':
 	case '$size':
 		var size = 0;
 		var size = 0;
-		if (currval instanceof String || typeof(currval) === 'string')
+		if ( typeof(currval) === 'string')
 			// matching old odd semantics
 			// matching old odd semantics
 			size = 0;
 			size = 0;
-		else if (typeof(currval) === 'number' || currval instanceof Number)
+		else if (typeof(currval) === 'number')
 			size = currval;
 			size = currval;
 		else {
 		else {
 			return {code:ErrorCodes.BAD_VALUE, description:"$size needs a number"};
 			return {code:ErrorCodes.BAD_VALUE, description:"$size needs a number"};
@@ -633,7 +634,7 @@ proto._parseSubField = function _parseSubField(context, andSoFar, name, element)
 		return {code:ErrorCodes.OK, result:temp2};
 		return {code:ErrorCodes.OK, result:temp2};
 
 
 	case '$type':
 	case '$type':
-		if (!(currval instanceof Number || typeof(currval) === 'number'))
+		if (typeof(currval) != 'number')
 			return {code:ErrorCodes.BAD_VALUE, description:"$type has to be a number"};
 			return {code:ErrorCodes.BAD_VALUE, description:"$type has to be a number"};
 		var type = currval;
 		var type = currval;
 		temp = new TypeMatchExpression();
 		temp = new TypeMatchExpression();
@@ -670,8 +671,10 @@ proto._parseSubField = function _parseSubField(context, andSoFar, name, element)
 	case '$geoIntersects':
 	case '$geoIntersects':
 	case '$near':
 	case '$near':
 	case '$nearSphere':
 	case '$nearSphere':
+		var x = 'Temporary value until Geo fns implimented.';
 		return this.expressionParserGeoCallback(name, x, context);
 		return this.expressionParserGeoCallback(name, x, context);
-
+	default:
+		return {code:ErrorCodes.BAD_VALUE, description:"not handled: " + element};
 	} // end switch
 	} // end switch
 
 
 
 

+ 2 - 2
lib/pipeline/matcher/ModMatchExpression.js

@@ -102,7 +102,7 @@ proto.init = function init( path,divisor,remainder ) { //  const StringData& pat
  */
  */
 proto.matchesSingleElement = function matchesSingleElement( e ) { //  const BSONElement& e 
 proto.matchesSingleElement = function matchesSingleElement( e ) { //  const BSONElement& e 
 // File: expression_leaf.cpp lines: 247-250
 // File: expression_leaf.cpp lines: 247-250
-	if(!(typeof(e) == 'number')) {
+	if(typeof(e) != 'number') {
 		return false;
 		return false;
 	}
 	}
 	
 	
@@ -119,7 +119,7 @@ proto.matchesSingleElement = function matchesSingleElement( e ) { //  const BSON
  */
  */
 proto.shallowClone = function shallowClone( /*  */ ){
 proto.shallowClone = function shallowClone( /*  */ ){
 // File: expression_leaf.h lines: 194-197
 // File: expression_leaf.h lines: 194-197
-	var e = new ModMatchObject();
+	var e = new ModMatchExpression();
 	e.init(this.path(),this._divisor, this._remainder);
 	e.init(this.path(),this._divisor, this._remainder);
 	return e;
 	return e;
 };
 };

+ 3 - 2
lib/pipeline/matcher/OrMatchExpression.js

@@ -36,6 +36,7 @@ proto.matches = function matches( doc,details ) { //  const MatchableDocument* d
 			return true;
 			return true;
 		}
 		}
 	}	
 	}	
+	return false;
 };
 };
 
 
 
 
@@ -66,10 +67,10 @@ proto.matchesSingleElement = function matchesSingleElement( e ) { //  const BSON
  */
  */
 proto.shallowClone = function shallowClone( /*  */ ){
 proto.shallowClone = function shallowClone( /*  */ ){
 // File: expression_tree.h lines: 86-91
 // File: expression_tree.h lines: 86-91
-	clone = new OrMatchExpression();
+	var clone = new OrMatchExpression();
 	for (var i = 0; i < this.numChildren(); i++) {
 	for (var i = 0; i < this.numChildren(); i++) {
 		clone.add(this.getChild(i).shallowClone());
 		clone.add(this.getChild(i).shallowClone());
 	}
 	}
 	return clone;
 	return clone;
-}
+};
 
 

+ 1 - 1
lib/pipeline/matcher/TagData.js

@@ -18,7 +18,7 @@ var TagData = module.exports = function TagData (){
  *
  *
  */
  */
 proto.debugString = function debugString() {
 proto.debugString = function debugString() {
-	throw Error('Virtual function called.');
+	throw new Error('Virtual function called.');
 };
 };
 
 
 // Below this line is manually generated based on inferred info in the source.
 // Below this line is manually generated based on inferred info in the source.

+ 1 - 1
lib/pipeline/matcher/TypeMatchExpression.js

@@ -142,7 +142,7 @@ proto._matches = function _matches(doc,path,details) {
 	}
 	}
 	*/
 	*/
 	return true;
 	return true;
-}
+};
 
 
 
 
 
 

+ 8 - 8
test/lib/pipeline/matcher/ComparisonMatchExpression.js

@@ -9,20 +9,20 @@ module.exports = {
 		"Should properly initialize with an empty path and a number": function (){
 		"Should properly initialize with an empty path and a number": function (){
 			var e = new ComparisonMatchExpression();
 			var e = new ComparisonMatchExpression();
 			e._matchType = 'LT';
 			e._matchType = 'LT';
-			assert.strictEqual(e.init('', 5 )['code'],'OK');
+			assert.strictEqual(e.init('', 5 ).code,'OK');
 		},
 		},
 		"Should not initialize when given an undefined rhs": function() {
 		"Should not initialize when given an undefined rhs": function() {
 			var e = new ComparisonMatchExpression();
 			var e = new ComparisonMatchExpression();
-			assert.strictEqual(e.init('',5)['code'],'BAD_VALUE');
+			assert.strictEqual(e.init('',5).code,'BAD_VALUE');
 			e._matchType = 'LT';
 			e._matchType = 'LT';
-			assert.strictEqual(e.init('',{})['code'],'BAD_VALUE');	
-			assert.strictEqual(e.init('',undefined)['code'],'BAD_VALUE');
-			assert.strictEqual(e.init('',{})['code'],'BAD_VALUE');
+			assert.strictEqual(e.init('',{}).code,'BAD_VALUE');	
+			assert.strictEqual(e.init('',undefined).code,'BAD_VALUE');
+			assert.strictEqual(e.init('',{}).code,'BAD_VALUE');
 		},
 		},
 		"Should match numbers with GTE": function (){
 		"Should match numbers with GTE": function (){
 			var e = new ComparisonMatchExpression();
 			var e = new ComparisonMatchExpression();
 			e._matchType = 'GTE';
 			e._matchType = 'GTE';
-			assert.strictEqual(e.init('',5)['code'],'OK');
+			assert.strictEqual(e.init('',5).code,'OK');
 			assert.ok(e.matchesSingleElement(6), "6 ≥ 5");
 			assert.ok(e.matchesSingleElement(6), "6 ≥ 5");
 			assert.ok(e.matchesSingleElement(5), "5 ≥ 5");
 			assert.ok(e.matchesSingleElement(5), "5 ≥ 5");
 			assert.ok(!e.matchesSingleElement(4), "4 ≥ 5");
 			assert.ok(!e.matchesSingleElement(4), "4 ≥ 5");
@@ -31,13 +31,13 @@ module.exports = {
 		"Should match with simple paths and GTE": function(){
 		"Should match with simple paths and GTE": function(){
 			var e = new ComparisonMatchExpression();
 			var e = new ComparisonMatchExpression();
 			e._matchType = 'GTE';
 			e._matchType = 'GTE';
-			assert.strictEqual(e.init('a', 5)['code'],'OK');
+			assert.strictEqual(e.init('a', 5).code,'OK');
 			assert.ok(e.matches({'a':6}));
 			assert.ok(e.matches({'a':6}));
 		},
 		},
 		"Should match arrays with GTE": function (){
 		"Should match arrays with GTE": function (){
 			var e = new ComparisonMatchExpression();
 			var e = new ComparisonMatchExpression();
 			e._matchType = 'GTE';
 			e._matchType = 'GTE';
-			assert.strictEqual(e.init('a',5)['code'],'OK');
+			assert.strictEqual(e.init('a',5).code,'OK');
 			assert.ok(e.matches({'a':[6,10]}),'[6,10] ≥ 5');
 			assert.ok(e.matches({'a':[6,10]}),'[6,10] ≥ 5');
 			assert.ok(e.matches({'a':[4,5.5]}), '[4,5.5] ≥ 5');
 			assert.ok(e.matches({'a':[4,5.5]}), '[4,5.5] ≥ 5');
 			assert.ok(!e.matches({'a':[1,2]}),'[1,2] ≥ 5');
 			assert.ok(!e.matches({'a':[1,2]}),'[1,2] ≥ 5');

+ 2 - 2
test/lib/pipeline/matcher/InMatchExpression.js

@@ -1,6 +1,6 @@
 "use strict";
 "use strict";
 var assert = require("assert"),
 var assert = require("assert"),
-    	MatchDetails = require('../../../../lib/pipeline/matcher/MatchDetails'),
+	MatchDetails = require('../../../../lib/pipeline/matcher/MatchDetails'),
 	InMatchExpression = require("../../../../lib/pipeline/matcher/InMatchExpression");
 	InMatchExpression = require("../../../../lib/pipeline/matcher/InMatchExpression");
 
 
 
 
@@ -66,7 +66,7 @@ module.exports = {
 			assert.strictEqual( s.code,'OK' );
 			assert.strictEqual( s.code,'OK' );
 
 
 			e._arrayEntries._equalities = [null];
 			e._arrayEntries._equalities = [null];
-			debugger;
+			
 			assert.ok( e.matches({}) );
 			assert.ok( e.matches({}) );
 			assert.ok( e.matches({'a':null}) );
 			assert.ok( e.matches({'a':null}) );
 			assert.ok( ! e.matches({'a':4}) );
 			assert.ok( ! e.matches({'a':4}) );

+ 3 - 3
test/lib/pipeline/matcher/MatchExpressionParser.js

@@ -10,8 +10,8 @@ module.exports = {
 			var parser =  new MatchExpressionParser();
 			var parser =  new MatchExpressionParser();
 			var res = parser.parse(goodQ);
 			var res = parser.parse(goodQ);
 			assert.strictEqual(res.code,'OK',res.description);
 			assert.strictEqual(res.code,'OK',res.description);
-			assert.ok( res['result'].matches(goodQ));
-			assert.ok( ! res['result'].matches(badQ));
+			assert.ok( res.result.matches(goodQ));
+			assert.ok( ! res.result.matches(badQ));
 		},
 		},
 		"Should parse {x:5,y:{$gt:5, :$lt:8}}": function() {
 		"Should parse {x:5,y:{$gt:5, :$lt:8}}": function() {
 			var q = {'x':5, 'y':{'$gt':5, '$lt':8}};
 			var q = {'x':5, 'y':{'$gt':5, '$lt':8}};
@@ -422,7 +422,7 @@ module.exports = {
 		"Should parse and match String $type": function() {
 		"Should parse and match String $type": function() {
 			var parser = new MatchExpressionParser();
 			var parser = new MatchExpressionParser();
 			var q = {'x':{'$type': 2 }};
 			var q = {'x':{'$type': 2 }};
-			debugger;
+			
 			var res = parser.parse( q );
 			var res = parser.parse( q );
 			assert.strictEqual( res.code,'OK',res.description );
 			assert.strictEqual( res.code,'OK',res.description );
 			assert.ok( res.result.matches({'x': 'abc'}) );
 			assert.ok( res.result.matches({'x': 'abc'}) );

+ 1 - 1
test/lib/pipeline/matcher/NorMatchExpression.js

@@ -1,6 +1,6 @@
 "use strict";
 "use strict";
 var assert = require("assert"),
 var assert = require("assert"),
-    	NorMatchExpression = require("../../../../lib/pipeline/matcher/NorMatchExpression.js"),
+	NorMatchExpression = require("../../../../lib/pipeline/matcher/NorMatchExpression.js"),
 	AndMatchExpression = require("../../../../lib/pipeline/matcher/AndMatchExpression.js"),
 	AndMatchExpression = require("../../../../lib/pipeline/matcher/AndMatchExpression.js"),
 	LTMatchExpression = require("../../../../lib/pipeline/matcher/LTMatchExpression.js"),
 	LTMatchExpression = require("../../../../lib/pipeline/matcher/LTMatchExpression.js"),
 	GTMatchExpression = require("../../../../lib/pipeline/matcher/GTMatchExpression.js"),
 	GTMatchExpression = require("../../../../lib/pipeline/matcher/GTMatchExpression.js"),

+ 6 - 6
test/lib/pipeline/matcher/NotMatchExpression.js

@@ -9,26 +9,26 @@ module.exports = {
 	"NotMatchExpression": {
 	"NotMatchExpression": {
 		"Should match a scalar": function (){
 		"Should match a scalar": function (){
 			var lt = new LTMatchExpression();
 			var lt = new LTMatchExpression();
-			assert.strictEqual(lt.init('a', 5)['code'],'OK');
+			assert.strictEqual(lt.init('a', 5).code,'OK');
 			var op = new NotMatchExpression();
 			var op = new NotMatchExpression();
-			assert.strictEqual( op.init(lt)['code'], 'OK');
+			assert.strictEqual( op.init(lt).code, 'OK');
 			assert.ok( op.matches({'a':6}), '{$not: {$lt: 5}}, {a:6}' );
 			assert.ok( op.matches({'a':6}), '{$not: {$lt: 5}}, {a:6}' );
 			assert.ok( !op.matches({'a':4}), '{$not: {$lt: 5}}, {a:4}' );
 			assert.ok( !op.matches({'a':4}), '{$not: {$lt: 5}}, {a:4}' );
 		},
 		},
 		"Should match an Array": function() {
 		"Should match an Array": function() {
 			var lt = new LTMatchExpression();
 			var lt = new LTMatchExpression();
-			assert.strictEqual(lt.init('a',5)['code'],'OK');
+			assert.strictEqual(lt.init('a',5).code,'OK');
 			var op = new NotMatchExpression();
 			var op = new NotMatchExpression();
-			assert.strictEqual(op.init(lt)['code'],'OK');
+			assert.strictEqual(op.init(lt).code,'OK');
 			assert.ok( op.matches({'a': [6]}) , '{$not: {$lt: 5}}, {a: [6]}');	
 			assert.ok( op.matches({'a': [6]}) , '{$not: {$lt: 5}}, {a: [6]}');	
 			assert.ok( !op.matches({'a': [4]}) , '{$not: {$lt: 5}}, {a: [4]}');	
 			assert.ok( !op.matches({'a': [4]}) , '{$not: {$lt: 5}}, {a: [4]}');	
 			assert.ok( !op.matches({'a': [4,5,6]}) , '{$not: {$lt: 5}}, {a: [4,5,6]}');
 			assert.ok( !op.matches({'a': [4,5,6]}) , '{$not: {$lt: 5}}, {a: [4,5,6]}');
 		},
 		},
 		"Should not have an ElemMatchKey": function() {
 		"Should not have an ElemMatchKey": function() {
 			var lt = new LTMatchExpression();
 			var lt = new LTMatchExpression();
-			assert.strictEqual(lt.init('a',5)['code'],'OK');
+			assert.strictEqual(lt.init('a',5).code,'OK');
 			var op = new NotMatchExpression();
 			var op = new NotMatchExpression();
-			assert.strictEqual( op.init( lt )['code'],'OK');
+			assert.strictEqual( op.init( lt ).code,'OK');
 			var details = new MatchDetails();
 			var details = new MatchDetails();
 			details.requestElemMatchKey();
 			details.requestElemMatchKey();
 			assert.ok( ! op.matches({'a':[1]}, details), '{$not: {a: {$lt : 5}}}, {a: [1]}' );
 			assert.ok( ! op.matches({'a':[1]}, details), '{$not: {a: {$lt : 5}}}, {a: [1]}' );

+ 1 - 1
test/lib/pipeline/matcher/OrMatchExpression.js

@@ -1,6 +1,6 @@
 "use strict";
 "use strict";
 var assert = require("assert"),
 var assert = require("assert"),
-    	OrMatchExpression = require("../../../../lib/pipeline/matcher/OrMatchExpression.js"),
+	OrMatchExpression = require("../../../../lib/pipeline/matcher/OrMatchExpression.js"),
 	AndMatchExpression = require("../../../../lib/pipeline/matcher/AndMatchExpression.js"),
 	AndMatchExpression = require("../../../../lib/pipeline/matcher/AndMatchExpression.js"),
 	LTMatchExpression = require("../../../../lib/pipeline/matcher/LTMatchExpression.js"),
 	LTMatchExpression = require("../../../../lib/pipeline/matcher/LTMatchExpression.js"),
 	GTMatchExpression = require("../../../../lib/pipeline/matcher/GTMatchExpression.js"),
 	GTMatchExpression = require("../../../../lib/pipeline/matcher/GTMatchExpression.js"),

+ 40 - 0
test/lib/pipeline/matcher/TypeMatchExpression.js

@@ -0,0 +1,40 @@
+"use strict";
+var assert = require("assert"),
+	TypeMatchExpression = require("../../../../lib/pipeline/matcher/TypeMatchExpression");
+
+
+module.exports = {
+	"TypeMatchExpression": {
+		"should match string type": function (){
+			
+		},
+		"should match null type": function() {
+			
+		},
+		"should match unknown type": function() {
+		
+		},
+		"should match bool type": function() {
+		
+		},
+		"should match number type": function() {
+		
+		},
+		"should match array  type": function() {
+		
+		},
+		"should match null type more": function() {
+		
+		},
+		"should match and preserve elemMatchKey": function() {
+		
+		},
+		"should be equivalent": function() {
+		
+		}
+
+	}
+};
+
+if (!module.parent)(new(require("mocha"))()).ui("exports").reporter("spec").addFile(__filename).run(process.exit);
+