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.
This commit is contained in:
parent
8ca6d2e0ba
commit
0503ad3295
|
@ -91,7 +91,7 @@ AbstractClass.prototype._initProperties = function (data, applySetters) {
|
||||||
try {
|
try {
|
||||||
self.__data[attr] = JSON.parse(self.__data[attr] + '');
|
self.__data[attr] = JSON.parse(self.__data[attr] + '');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e.stack);
|
self.__data[attr] = String(self.__data[attr]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type.name === 'Array' || typeof type === 'object' && type.constructor.name === 'Array') {
|
if (type.name === 'Array' || typeof type === 'object' && type.constructor.name === 'Array') {
|
||||||
|
|
Loading…
Reference in New Issue