diff --git a/src/instance/attributes.js b/src/instance/attributes.js index c961a208b9..8624b0ffdc 100644 --- a/src/instance/attributes.js +++ b/src/instance/attributes.js @@ -63,7 +63,8 @@ serializeValue: function(value, inferredType) { if (inferredType === 'boolean') { return value ? '' : undefined; - } else if (inferredType !== 'object' && value !== undefined) { + } else if (inferredType !== 'object' && inferredType !== 'function' + && value !== undefined) { return value; } }, diff --git a/src/lib/deserialize.js b/src/lib/deserialize.js index 84a4374bc3..c3e1134a72 100644 --- a/src/lib/deserialize.js +++ b/src/lib/deserialize.js @@ -36,6 +36,10 @@ // The object isn't valid JSON, return the raw value return value; } + }, + // avoid deserialization of functions + 'function': function(value, currentValue) { + return currentValue; } };