CFLint icon indicating copy to clipboard operation
CFLint copied to clipboard

Parse Error with unquoted negative value for case statement

Open zspitzer opened this issue 6 years ago • 1 comments

with 1.4.1,

the -1 value causes a parse error, adding quotes around the -1 fixes it

<cfscript>
    function doSomething(id){
		switch (id){
			case -1:
				return "new";
			default:
				return "existing";
		}
    }
</cfscript>

zspitzer avatar Apr 02 '19 10:04 zspitzer

depends on https://github.com/cfparser/cfparser/issues/127 moving to next milestone

ryaneberly avatar Sep 17 '19 02:09 ryaneberly