messing around with serialized types test

This commit is contained in:
jatchili
2013-09-10 16:10:49 -07:00
parent 3807c1ba6a
commit 21aed214a7
3 changed files with 45 additions and 50 deletions

View File

@@ -153,7 +153,7 @@ SerializedObject.prototype.to_json = function() {
function jsonify_structure(thing, field_name) {
var output;
console.log("JSONIFYING:", thing, field_name);
switch (typeof thing) {
case 'number':
switch (field_name) {
@@ -167,6 +167,9 @@ function jsonify_structure(thing, field_name) {
output = TRANSACTION_TYPES[thing] || thing;
break;
default:
if (typeof thing.to_json === 'function') {
console.log("WE COULD HAVE DONE:", thing.to_json());
}
output = thing;
}
break;
@@ -187,7 +190,7 @@ function jsonify_structure(thing, field_name) {
default:
output = thing;
}
console.log("AND THE RESULT WAS:", output);
return output;
};