Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes for strict mode #1232

Closed
wants to merge 2 commits into from
Closed

Conversation

csantero
Copy link

A couple fixes to allow running with --harmony and --use-strict

@@ -196,6 +196,7 @@ mocha.ui(program.ui);

// load reporter

var Reporter;
try {
Reporter = require('../lib/reporters/' + program.reporter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@csantero rather than confining Reporter to the module scope, it seems you should try removing the var Reporter; statement and adding global.Reporter = require.... instead.

@travisjeffery
Copy link
Contributor

needs to be documented here: https://github.com/visionmedia/mocha/blob/master/bin/_mocha#L61..L95

thanks

@csantero
Copy link
Author

csantero commented Jul 5, 2014

@travisjeffery Updated. Sorry about the delay.

@travisjeffery
Copy link
Contributor

ah now that i'm trying this, i'm noticing all the code that would have to change - since nested functions would need be declared at the top of their containing function. that goes against our coding style so i don't think this gonna make it. it's a better practice to use 'use strict' in your files anyway imo.

@dcousens
Copy link

dcousens commented Nov 5, 2015

Is this still the case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants