From 296115f0650c967582704a9ab41eaebdf1908bf3 Mon Sep 17 00:00:00 2001 From: Chris Santero Date: Thu, 29 May 2014 16:23:08 -0400 Subject: [PATCH 1/2] fixes for strict mode --- bin/_mocha | 4 ++-- bin/mocha | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/_mocha b/bin/_mocha index d6b2030065..893ee3f283 100755 --- a/bin/_mocha +++ b/bin/_mocha @@ -198,10 +198,10 @@ mocha.ui(program.ui); // load reporter try { - Reporter = require('../lib/reporters/' + program.reporter); + global.Reporter = require('../lib/reporters/' + program.reporter); } catch (err) { try { - Reporter = require(program.reporter); + global.Reporter = require(program.reporter); } catch (err) { throw new Error('reporter "' + program.reporter + '" does not exist'); } diff --git a/bin/mocha b/bin/mocha index 742d60779e..a67a0c3664 100755 --- a/bin/mocha +++ b/bin/mocha @@ -29,6 +29,7 @@ process.argv.slice(2).forEach(function(arg){ case '--harmony-proxies': case '--harmony-collections': case '--harmony-generators': + case '--use-strict': case '--prof': args.unshift(arg); break; From e5f7cd806322489bfbca099455fffc6d4b7cb552 Mon Sep 17 00:00:00 2001 From: Chris Santero Date: Sat, 5 Jul 2014 11:16:08 -0400 Subject: [PATCH 2/2] document strict mode option in help output --- bin/_mocha | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/_mocha b/bin/_mocha index 893ee3f283..6cb2536aeb 100755 --- a/bin/_mocha +++ b/bin/_mocha @@ -92,6 +92,7 @@ program .option('--recursive', 'include sub directories') .option('--reporters', 'display available reporters') .option('--trace', 'trace function calls') + .option('--use-strict', 'enable javascript strict mode') .option('--watch-extensions ,...', 'additional extensions to monitor with --watch', list, []) program.name = 'mocha';