Status/Resolution/Reason: Closed/Withdrawn/AsDesigned
Reporter/Name(from Bugbase): Aaron Neff / ()
Created: 05/21/2018
Components: Language, Null Support
Versions: 2018
Failure Type: Incorrectly functioning
Found In Build/Fixed In Build: 2018.0.01.308605 (PreRelease) /
Priority/Frequency: Normal / Some users will encounter
Locale/System: / Platforms All
Vote Count: 1
Issue: NULL is not final
Steps to Reproduce:
1) Run:
-----------
<cfscript>
null = "asdf"
foo = variables.null
bar = null
writeDump(variables)
</cfscript>
-----------
Actual Result:
-----------
struct
BAR: asdf
FOO: asdf
NULL: asdf
-----------
Expected Result:
-----------
struct
BAR: [null]
FOO: asdf
NULL: asdf
-----------
2) Run:
-----------
<cfscript>
function null() {
var bar = null
return bar
}
writeDump(null())
writeDump(variables)
</cfscript>
-----------
Actual Result:
-----------
function null
Arguments: none
ReturnType: Any
Roles:
Access: public
Output:
DisplayName:
Hint:
Description:
struct
NULL:
[function]
Arguments: none
ReturnType: Any
Roles:
Access: public
Output:
DisplayName:
Hint:
Description:
-----------
Expected Result:
-----------
[null]
struct
NULL:
[function]
Arguments: none
ReturnType: Any
Roles:
Access: public
Output:
DisplayName:
Hint:
Description:
-----------
Suggestions:
1) `bar=null` should always be shorthand for `bar=javaCast("null","")`
2) `var bar=null` should always be shorthand for `var bar=javaCast("null","")`
3) scoping is required, in order to set bar equal to the value of a variable named null (ex: `bar=variables.null` and `var bar=local.null`)
Related post: http://blog.cfaether.com/2018/05/null-can-be-overridden.html
Attachments:
Comments: