diff --git a/env/wsh.js b/env/wsh.js index 75c58ca666..8261322c7b 100644 --- a/env/wsh.js +++ b/env/wsh.js @@ -1,5 +1,5 @@ -/*jshint evil: true */ -/*global ActiveXObject: false, JSHINT: false, WScript: false */ +/*jshint evil: true, wsh: true */ +/*global JSHINT: false */ (function() { var formatters = { diff --git a/jshint.js b/jshint.js index 4df54c5ddf..2c91be4e35 100644 --- a/jshint.js +++ b/jshint.js @@ -208,7 +208,8 @@ slice, sort,spawn, split, stack, status, start, strict, sub, substr, supernew, shadow, supplant, sum, sync, test, toLowerCase, toString, toUpperCase, toint32, token, top, type, typeOf, Uint16Array, Uint32Array, Uint8Array, undef, - unused, urls, value, valueOf, var, version, WebSocket, white, window, Worker + unused, urls, value, valueOf, var, version, WebSocket, white, window, Worker, + wsh */ /*global exports: false */ @@ -281,7 +282,8 @@ var JSHINT = (function () { strict : true, // require the "use strict"; pragma sub : true, // if all forms of subscript notation are tolerated supernew : true, // if `new function () { ... };` and `new Object;` should be tolerated - white : true // if strict whitespace rules apply + white : true, // if strict whitespace rules apply + wsh : true // if the Windows Scripting Host environment globals should be predefined }, // browser contains a set of global names which are commonly provided by a @@ -604,6 +606,19 @@ var JSHINT = (function () { urls, warnings, + wsh = { + ActiveXObject : true, + Enumerator : true, + GetObject : true, + ScriptEngine : true, + ScriptEngineBuildVersion : true, + ScriptEngineMajorVersion : true, + ScriptEngineMinorVersion : true, + VBArray : true, + WSH : true, + WScript : true + }, + // Regular expressions. Some of these are stupidly long. // unsafe comment or string @@ -754,6 +769,9 @@ var JSHINT = (function () { if (option.mootools) combine(predefined, mootools); + if (option.wsh) + combine(predefined, wsh); + if (option.globalstrict) option.strict = true; }