russplaysguitar / navel

Working towards a linter for cfscript
MIT License
2 stars 0 forks source link

Array index of 0 #14

Closed russplaysguitar closed 11 years ago

russplaysguitar commented 11 years ago

Attempts to access array index of zero (or negative values) should fail lint.

Example failures:

var x = myArray[0];

myArray[0] = 1;

var x = myArray[-1];

I can't think of any time when you'd even write [0] (or have a negative constant index) in cfml.

adamcameron commented 11 years ago

That gives a runtime error if one tries it, so not really in scope for a code quality tool: it goes without saying, surely, that the code needs to be actually valid.

russplaysguitar commented 11 years ago

good point, it is a waste of energy to include things that already give a runtime error