Just a quick warning about the CHF I just blogged about. It makes a small change to the LOCAL scope that can impact your code. It definitely breaks MXUnit's test runner. The change involves code that sets LOCAL variable. Imagine the following UDF:
You can only assign LOCAL to a struct. You cannot assign LOCAL to java.lang.String This is easy enough to fix, and easy to fix within MXUnit. Just find runner/HtmlRunner.cfc and delete line 13, which should be:
1 <cfscript>
2 function foo() {
3 var local = "";
4 local.x = 1;
5 return x;
6 }
7 </cfscript>
8
9 <cfoutput>#foo()#</cfoutput>
Notice how I set local to a string, and then treat is a structure later. While that may be a bit sloppy, it works fine until you apply the CHF. Once you do, you get:
LOCAL is explicit scope in ColdFusion 9.2 function foo() {
3 var local = "";
4 local.x = 1;
5 return x;
6 }
7 </cfscript>
8
9 <cfoutput>#foo()#</cfoutput>
You can only assign LOCAL to a struct. You cannot assign LOCAL to java.lang.String This is easy enough to fix, and easy to fix within MXUnit. Just find runner/HtmlRunner.cfc and delete line 13, which should be:
1 <cfset var local = "">


Comment 1 written by Randy Merrill on 20 February 2010, at 10:55 AM
Comment 2 written by Dan G. Switzer, II on 22 February 2010, at 9:48 AM
Comment 3 written by Raymond Camden on 22 February 2010, at 9:49 AM