commandline paramater "indent" is passed by wsh.js to jshint as a string and not a number #671

Closed
vigneshm opened this Issue Oct 4, 2012 · 1 comment

Projects

None yet

2 participants

@vigneshm

wsh.js parses the command line parameters to string values and passes it directly to jshint without converting it to a Number.

jshint, on the other hand, doesn't convert option.indent to a Number too. This totally breaks jshint.

Steps to reproduce:
CScript.exe env/wsh.js /indent:4 test.js

// Contents of test.js
function test() {
alert("testing");
}

jshint throws the following errors
Line 2 character 5: Expected 'alert' to have an indentation at 140 instead at 5
Line 3 character 1: Expected '}' to have an indentation at 10 instead at 1

P.S: Other parameters like 'maxparams' which expect a number value, will also be affected.

@vigneshm

Please ignore the previous commit. GitHub windows app messed up the diff file.

@valueof valueof added a commit that closed this issue Oct 13, 2012
@valueof valueof WSH: Convert numeric parameters to numbers
For some reason, WSH wrapper was passing numeric parameters as
strings and JSHint couldn't understand them. This patch converts
to numbers all parameters that can be converted.

Fixes GH-671.
c6058c0
@valueof valueof closed this in c6058c0 Oct 13, 2012
@jugglinmike jugglinmike added a commit to jugglinmike/jshint that referenced this issue Oct 21, 2014
@valueof valueof WSH: Convert numeric parameters to numbers
For some reason, WSH wrapper was passing numeric parameters as
strings and JSHint couldn't understand them. This patch converts
to numbers all parameters that can be converted.

Fixes GH-671.
adbdca7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment