Fixed
Details
Assignee
Pothys - MitrahSoftPothys - MitrahSoftReporter
Brad WoodBrad WoodNew Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
NoneFix versions
Priority
New
Details
Details
Assignee
Pothys - MitrahSoft
Pothys - MitrahSoftReporter
Brad Wood
Brad WoodNew Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
None
Fix versions
Priority
Created 20 April 2017 at 20:20
Updated 16 June 2023 at 15:36
Resolved 12 June 2023 at 07:57
foo = 'test' foo == 'test' foo === 'test'
This code run from a REPL outputs true, false because it checks to see if the two variables are the same objects in memory. The === has been widely accepted to perform a type check in languages like JavaScript however (which would return true in both cases).
Change the === operator to check for value equality and type equality instead. This will bring Lucee more in line with other languages and will be a much more useful operator in a dynamic language.
It's also worth noting, that this change will be loosening the current definition so no existing code will start returning false that currently returns true. I personally think anyone using it thought it was doing a type check all along (if anyone has, in fact, been using this).
Breaking Changes
this also affects the == operator with complex objects to match ACF, see https://luceeserver.atlassian.net/browse/LDEV-4548