I am curious to know, though, if this is considered a "bug" -- since it
breaks code that worked perfectly well before 7.0.1 -- and makes it
tough to write code that uses try/catch in this way that can work in
both 7.0.1 and previous CFMX builds.
Or, was doing the "var e" not doing anything useful in previous builds
anyway?
Sean Corfield wrote:
On 10/23/05, Adam Cameron <[EMAIL PROTECTED]> wrote:
I can recall this being the case in 6.1, but doesn't *seem* to be that way in
CFMX7.0 (provided you VAR the exception variable, natch).
Yes, in CFMX 7 you could 'var' the exception variable (I thought you
could in CFMX 6.1 as well?). In the tag-based version, the implicit
'cfcatch' variable is now created automagically in the local 'var'
scope (which was not the case in CFMX 6.1 - not sure about 7.0). I
suspect that this is an attempt to make the tag-based and script-based
versions behave similarly in a thread-safe manner without requiring
folks to 'var' declare things.
Right. The fact that it doesn't really seem broken in CFMX7 notwithstanding,
my approach to this would be the same as with any other variable... You create
the local variable with the VAR keyword at the top of the function. Why the
different approach here?
I think that in C++ and Java, the exception variable is declared
(locally) by its use in the catch() clause so this makes cfscript less
surprising for C++ / Java developers. I haven't checked this but that
is my recollection.
Whilst on the subject of 7.0.1... Was there a beta programme for it? The first
I heard about it was when it was released :-(
Yes, there was a beta program - and it was mentioned on both Tim
Buntel's and Damon Cooper's blog - but I believe the criteria were
tighter than the beta for 7.0 since the team were specifically
focusing on certain issues.
--
Sean A Corfield -- http://corfield.org/
Got frameworks?
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
cfcdev@cfczone.org with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at
www.mail-archive.com/cfcdev@cfczone.org
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
cfcdev@cfczone.org with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at
www.mail-archive.com/cfcdev@cfczone.org