ColdFusion's ToScript() Function Works Differently in CF11 than in CF2018. Why?
Hi all
We upgraded from CF11 to CF2018 recently. Today we found a JavaScript error due to a difference in the way ColdFusion's ToScript() function returns its data.
The ColdFusion structure going into the ToScript() function looks like this:
<cfdump var=#allowedLevels# />

The above structure is passed to ToScript() as follows:
var #toScript(allowedLevels, "allowedLevels")#
In CF11 the results look like this:
var allowedLevels = new Object();
allowedLevels["1"] = new Array();
allowedLevels["1"][0] = "1";
allowedLevels["1"][1] = "2";
allowedLevels["2"] = new Array();
In CF2018 the results look like this:
var allowedLevels = new Object();
allowedLevels["1"] = new Array();
allowedLevels["1"][0] = 1;
allowedLevels["1"][1] = 2;
allowedLevels["2"] = new Array();
As you can see, the values in the second dimension of the array are created as Strings in CF11 and as Integers in CF 2018. Can anyone offer the reason why this is occurring, and how to fix it?
Thanks in advance.
