From 6428abe37a68cc42a44d2ada2e097504ca3150f0 Mon Sep 17 00:00:00 2001 From: Steve Orvell Date: Thu, 31 Oct 2013 15:06:57 -0700 Subject: [PATCH] avoid serialization of function valued properties. --- src/instance/attributes.js | 3 ++- src/lib/deserialize.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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; } };