diff --git a/src/platforms/jsc.js b/src/platforms/jsc.js index 440e8500c6..bc64800d22 100644 --- a/src/platforms/jsc.js +++ b/src/platforms/jsc.js @@ -5,19 +5,21 @@ // jsc ${env_home}/jsc.js -- ${file} "$(cat ${file})" "option1:true,option2:false ${env_home}" var env_home = ''; if (arguments.length > 3) { - env_home = arguments[3].toString().replace(/\/dist/, '/src/stable/'); + env_home = arguments[3].toString().replace(/\/dist/, '/src/stable/'); } load(env_home + "jshint.js"); if (typeof(JSHINT) === 'undefined') { - print('jshint: Could not load jshint.js, tried "' + env_home + 'jshint.js".'); - quit(); + print('jshint: Could not load jshint.js, tried "' + env_home + 'jshint.js".'); + quit(); } -(function(args){ +(function (args) { + "use strict"; + var name = args[0], input = args[1], - opts = (function(arg){ + opts = (function (arg) { var opts = {}; var item; diff --git a/src/platforms/rhino.js b/src/platforms/rhino.js index dde8224f64..2d7ade5c12 100644 --- a/src/platforms/rhino.js +++ b/src/platforms/rhino.js @@ -2,6 +2,8 @@ /*global JSHINT*/ (function (args) { + "use strict"; + var filenames = []; var optstr; // arg1=val1,arg2=val2,... var predef; // global1=true,global2,global3,... diff --git a/src/platforms/wsh.js b/src/platforms/wsh.js index ae165171bf..b3fddd54bc 100644 --- a/src/platforms/wsh.js +++ b/src/platforms/wsh.js @@ -1,7 +1,8 @@ -/*jshint evil: true, shadow: true, wsh: true, undef: true, unused: true */ -/*global JSHINT: false */ +/*global JSHINT, WScript, Enumerator */ + +(function () { + "use strict"; -(function() { function readFile(path, charset) { try { var stream = WScript.CreateObject("ADODB.Stream"); @@ -106,7 +107,7 @@ } var formatters = { - errors: function(errors, lines) { + errors: function (errors, lines) { for (var i = 0; i < errors.length; i++) { var error = errors[i]; @@ -114,13 +115,15 @@ if (i) lines.push(""); - lines.push("Line " + error.line + " character " + error.character + ": " + error.reason); + lines.push("Line " + error.line + " character " + + error.character + ": " + error.reason); - if (error.evidence) lines.push(" " + error.evidence.replace(/^\s*((?:[\S\s]*\S)?)\s*$/, "$1")); + if (error.evidence) lines.push(" " + + error.evidence.replace(/^\s*((?:[\S\s]*\S)?)\s*$/, "$1")); } }, - implieds: function(implieds, lines) { + implieds: function (implieds, lines) { lines.push("Implied globals:"); var globals = {}; @@ -138,7 +141,7 @@ } }, - unused: function(unused, lines) { + unused: function (unused, lines) { lines.push("Unused variables:"); var func, names = {}; @@ -166,6 +169,7 @@ // load JSHint if the two scripts have not been concatenated if (typeof JSHINT === "undefined") { + /*jshint evil:true */ eval(readFile(scriptPath + "..\\src\\stable\\jshint.js", 'utf-8')); if (typeof JSHINT === "undefined") { @@ -181,19 +185,28 @@ var unnamed = WScript.Arguments.Unnamed; if (unnamed.length !== 1) { - WScript.StdOut.WriteLine(" usage: cscript " + scriptName + " [options]