chapter31

development in a land far far away…

at the moment

History is not what happened. History is what was written down.

Those that use the sensational varscoper tool from Mike Schierberl know that cfscript is still a little experimental with the current release.

One of the things it can do is return variables that are actually “var” scoped as not var scoped when using cfscript. This seems to happen most often when you have a comment directly above the variable in question.

In the above example Varscoper tells me that “newRow” is not var scoped when clearly it is.

This is usually fine, but if you start to get a lot of these false positives there is a quick little workaround. Place a semi-colon at the end of the last comment which effectively tells varscoper where the statement finishes and fixes the problem.

Note the semi-colon after the 2nd comment. Now my reports are nice and clean :)


Related Pages

4 Responses to “Workaround for cfscript bug in varscoper”

  1. Nice one. Thanks.

    Indy Nagpal

  2. Do you mind posting an issue at RIAforge? I have a few other open ones there. Someday I’ll get around to them all, and I want to make sure I don’t miss this.

    -Mike

    Mike Schierberl

  3. OK, today is the day, the issue should be fixed in 1.20, I’ve posted the new version up on RIAForge.

    Mike Schierberl

  4. @Mike - thanks for that, I’ll check it out. Thanks again for a fantastic tool!

    Michael Sharman

Leave a Reply