From 0503ad3295c6d35d7e25c0015507ec9774be5b2f Mon Sep 17 00:00:00 2001 From: dgsan Date: Tue, 5 Mar 2013 12:02:07 -0700 Subject: [PATCH] This is the smash with blunt object fix for #215, since the more flexible #213 was rejected. There needs to be something done so that types not in `BASE_TYPES` can be parsed without throwing an exception and making things go nuts when they aren't JSON. As noted this is the blunt object solution and will not cover all cases, but something needs to be done. --- lib/abstract-class.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/abstract-class.js b/lib/abstract-class.js index 4c310504..d885ed83 100644 --- a/lib/abstract-class.js +++ b/lib/abstract-class.js @@ -91,7 +91,7 @@ AbstractClass.prototype._initProperties = function (data, applySetters) { try { self.__data[attr] = JSON.parse(self.__data[attr] + ''); } catch (e) { - console.log(e.stack); + self.__data[attr] = String(self.__data[attr]); } } if (type.name === 'Array' || typeof type === 'object' && type.constructor.name === 'Array') {