Browse Source

fix auto run line in examples

Kyle P Davis 10 years ago
parent
commit
2b51895743

+ 1 - 1
example/arrayClear.js

@@ -25,4 +25,4 @@ exports.arrayClear = {
 
 
 // if run directly run benchmarks
-if (!module.main) require("benchmarksman").runner(exports);
+if (!module.parent) require("benchmarksman").runner(exports);

+ 1 - 1
example/arrayExtend.js

@@ -58,4 +58,4 @@ exports.arrayExtend = {
 
 
 // if run directly run benchmarks
-if (!module.main) require("benchmarksman").runner(exports);
+if (!module.parent) require("benchmarksman").runner(exports);

+ 1 - 1
example/arrayForEach.js

@@ -26,4 +26,4 @@ exports.arrayForEach = {
 
 
 // if run directly run benchmarks
-if (!module.main) require("benchmarksman").runner(exports);
+if (!module.parent) require("benchmarksman").runner(exports);

+ 1 - 1
example/arrayIndexOf.js

@@ -41,4 +41,4 @@ exports.arrayIndexOf = {
 };
 
 // if run directly run benchmarks
-if (!module.main) require("benchmarksman").runner(exports);
+if (!module.parent) require("benchmarksman").runner(exports);

+ 1 - 1
example/dateGetTime.js

@@ -17,4 +17,4 @@ exports.dateGetTime = {
 
 
 // if run directly run benchmarks
-if (!module.main) require("benchmarksman").runner(exports);
+if (!module.parent) require("benchmarksman").runner(exports);

+ 1 - 1
example/jsonParse.js

@@ -29,4 +29,4 @@ exports.jsonParse = {
 
 
 // if run directly run benchmarks
-if (!module.main) require("benchmarksman").runner(exports);
+if (!module.parent) require("benchmarksman").runner(exports);

+ 1 - 1
example/knownSetHas.js

@@ -54,4 +54,4 @@ exports.knownSetHas = {
 
 
 // if run directly run benchmarks
-if (!module.main) require("benchmarksman").runner(exports);
+if (!module.parent) require("benchmarksman").runner(exports);

+ 1 - 1
example/maths.js

@@ -12,4 +12,4 @@ exports.maths = {
 
 };
 
-if (!module.main) require("benchmarksman").runner(exports);
+if (!module.parent) require("benchmarksman").runner(exports);

+ 1 - 1
example/objectHasKeys.js

@@ -54,4 +54,4 @@ exports.objectHasKeys = {
 
 
 // if run directly run benchmarks
-if (!module.main) require("benchmarksman").runner(exports);
+if (!module.parent) require("benchmarksman").runner(exports);

+ 1 - 1
example/typeArray.js

@@ -21,4 +21,4 @@ exports.typeArray = {
 
 
 // if run directly run benchmarks
-if (!module.main) require("benchmarksman").runner(exports);
+if (!module.parent) require("benchmarksman").runner(exports);

+ 1 - 1
example/typeObjectLoose.js

@@ -26,4 +26,4 @@ exports.typeObject = {
 
 
 // if run directly run benchmarks
-if (!module.main) require("benchmarksman").runner(exports);
+if (!module.parent) require("benchmarksman").runner(exports);

+ 1 - 1
test/benchmarksman_test.js

@@ -40,4 +40,4 @@ exports.benchmarksman = {
 };
 
 // Mocha one-liner to make these tests self-hosted
-if (!module.main) (new(require("mocha"))()).addFile(__filename).ui("exports").run(process.exit);
+if (!module.parent) (new(require("mocha"))()).addFile(__filename).ui("exports").run(process.exit);