tracker issue : CF-4119888

select a category, or use search below
(searches all categories and all time range)
Title:

toJson() method should work on numerics and booleans

| View in Tracker

Status/Resolution/Reason: To Test//Fixed

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 02/19/2016

Components: Language

Versions: 2016

Failure Type:

Found In Build/Fixed In Build: CF2016_Final /

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Platforms All

Vote Count: 3

See http://blog.adamcameron.me/2016/02/coldfusion-2016-tojson-method.html

Repro:

a = ["tahi"];
st = {two="rua"};
ost = {three="toru"};
q = queryNew("en,mi", "varchar,varchar",[["four","wha"]]);
cfxml(variable="x"){
	writeOutput("<five><rima/></five>");
}
s = "ono";
ts = now();
d = 42 * 1;
b = true == true;

CLI.writeLn(a.toJson());
CLI.writeLn(st.toJson());
CLI.writeLn(ost.toJson());
CLI.writeLn(q.toJson());
CLI.writeLn(q.toJson(true));
CLI.writeLn(x.toJson());
CLI.writeLn(s.toJson());
CLI.writeLn(ts.toJson());
//CLI.writeLn(d.toJson()); // not supported for numerics
//CLI.writeLn(b.toJson()); // not supported for booleans
CLI.writeLn(variables.toJson());

For the sake of completeness, you should also have implemented this on booleans and numeric.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4119888

External Customer Info:
External Company:  
External Customer Name: Adam Cameron
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments: