CF9 Compatibility for FB3Lite

I just made another minor tweak to FB3Lite to fix out-of-the-box ColdFusion 9 compatibility.  CF9 added a 'location' built-in function, which means that the function of the same name that FB3Lite provides now generates a compiler error.  Fortunately, since functions are real data within CFML, a simple realiasing gets around the issue.  This creates a subtle compatibility issue, but better than having to delete the UDF manually.

If your CFML engine does not provide a location function, FB3Lite will ensure one is available for you (simply wrapping CFLOCATION).  This has been the behaviour since the beginning.  Now, if your CFML engine does provide a location function, FB3Lite will still provide one in the variables scope (in case you're doing dynamic evaluation of it), but the engine-provided one will be used for static references (the typical case).

In general, this shouldn't matter to anyone; it's still just download and go.  The issue I alluded to above has to do with the optional parameters that CF9 provides (addToken and statusCode).  Since static invocations will use the built-in function, those optional params will be available on CF9, but will not on platforms that rely on FB3Lite's version.  Eventually I'd expect all CFML engines to provide a location function in which case there will no longer be a discrepancy, but for the meantime, if you're using multiple platforms, you'll need to ensure you're not using the optional parameters with the location function.

And before you say it, adding the parameters to the FB3Lite-provided function isn't an option, because CFLOCATION doesn't support statusCode until ColdFusion 8, which means you'd get compiler errors on CF7.

As always, the source is available, or you can check the project page for the latest info and updates.

Comments are closed.