Status/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Aaron Neff / ()
Created: 05/21/2018
Components: Language
Versions: 2018
Failure Type: Data Corruption
Found In Build/Fixed In Build: 2018.0.01.308605 (PreRelease) / 2018,0,0,309764
Priority/Frequency: Normal / All users will encounter
Locale/System: / Platforms All
Vote Count: 0
Issue: final ignored
Steps to Reproduce:
1) Run:
-----------
<cfscript>
final variables.foo = "final honored"
variables.foo = "final ignored"
writeOutput(foo)//if `foo` is changed to `variables.foo`, then coldfusion.compiler.FinalVariableMutationException is thrown
</cfscript>
-----------
Actual Result: final ignored
Expected Result: coldfusion.compiler.FinalVariableMutationException on line 3
2) Run:
-----------
<cfscript>
final variables.foo = "final honored"
variables.foo = "final ignored"
writeOutput(variables.foo)
foo = "I call hacks"//if this line is commented-out, then coldfusion.compiler.FinalVariableMutationException is thrown
</cfscript>
-----------
Actual Result: final ignored
Expected Result: coldfusion.compiler.FinalVariableMutationException on line 3
3) Run:
-----------
<cfscript>
final variables.foo = "final honored"
foo = "final ignored"
writeDump(foo)
</cfscript>
-----------
Actual Result: final ignored
Expected Result: coldfusion.compiler.FinalVariableMutationException on line 3
4) Run:
-----------
<cfscript>
function f() {
final local.foo = "final honored"
var foo = "final ignored"
return foo
}
writeDump(f())
</cfscript>
-----------
Actual Result: final ignored
Expected Result: coldfusion.compiler.FinalVariableMutationException on line 4
5) Run:
-----------
<cfscript>
final variables.foo = "final honored"
foo = function(){variables.bar="final ignored"}
foo()
writeOutput(isClosure(foo) & ' ' & bar)
</cfscript>
-----------
Actual Result: YES final ignored
Expected Result: coldfusion.compiler.FinalVariableMutationException on line 3
6) Run:
-----------
<cfscript>
final variables.foo = "bar"
function foo() {}//this line is completely ignored
writeDump(foo)
</cfscript>
-----------
Actual Result: bar
Expected Result: coldfusion.compiler.FinalVariableMutationException on line 3
7) Run:
-----------
<cfscript>
final cfthread="bar"
cfthread(name="myThread"){}
//thread name="myThread" {}//same issue
thread action="join" name="myThread";
writeDump(cfthread)
</cfscript>
-----------
Actual Result: bar
Expected Result: coldfusion.compiler.FinalVariableMutationException on line 3
8) Run:
mycustomtag.cfm
-----------
<cfscript>
if(THISTAG.executionMode == "start") {
final CALLER.foo = "final honored"
}
</cfscript>
-----------
index.cfm
-----------
<cfscript>
cfmodule(template="mycustomtag.cfm")
foo = "final ignored"
writeOutput(foo)
</cfscript>
-----------
Actual Result: final ignored
Expected Result: coldfusion.compiler.FinalVariableMutationException on index.cfm line 3
Related post: http://blog.cfaether.com/2018/05/final-ignored.html
Attachments:
Comments: