diff options
Diffstat (limited to 'node_modules/montage/core/deserializer.js')
-rwxr-xr-x | node_modules/montage/core/deserializer.js | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/node_modules/montage/core/deserializer.js b/node_modules/montage/core/deserializer.js index 2b3ed64e..86cdc560 100755 --- a/node_modules/montage/core/deserializer.js +++ b/node_modules/montage/core/deserializer.js | |||
@@ -246,7 +246,7 @@ var Deserializer = Montage.create(Montage, /** @lends module:montage/core/deseri | |||
246 | object = stack[ix-1], | 246 | object = stack[ix-1], |
247 | desc = stack[ix]; | 247 | desc = stack[ix]; |
248 | 248 | ||
249 | this._deserializeProperties(object, desc.properties); | 249 | this._deserializeProperties(object, desc.properties, false); |
250 | } | 250 | } |
251 | }, | 251 | }, |
252 | 252 | ||
@@ -331,9 +331,22 @@ var Deserializer = Montage.create(Montage, /** @lends module:montage/core/deseri | |||
331 | @param {Object} object The target of the properties. | 331 | @param {Object} object The target of the properties. |
332 | @param {Array} properties The property names to be deserialized. | 332 | @param {Array} properties The property names to be deserialized. |
333 | */ | 333 | */ |
334 | deserializePropertiesForObject: {value: function(object, properties) { | 334 | deserializePropertiesForObject: {value: function(object, properties, checkSerializableAttribute) { |
335 | for (var key in properties) { | 335 | if (checkSerializableAttribute) { |
336 | object[key] = properties[key]; | 336 | for (var key in properties) { |
337 | if (!Montage.getPropertyAttribute(object, key, "serializable")) { | ||
338 | if (Object.getPropertyDescriptor(object, key)) { | ||
339 | console.warn("Unserializable property \"" + key + "\" found in the serialization of " + (object._montage_metadata ? object._montage_metadata.objectName : object) + " (" + (this._origin || window.location) + ")"); | ||
340 | } else { | ||
341 | console.warn("Nonexistent (and therefore unserializable) property \"" + key + "\" found in the serialization of " + (object._montage_metadata ? object._montage_metadata.objectName : object) + " (" + (this._origin || window.location) + ")"); | ||
342 | } | ||
343 | }; | ||
344 | object[key] = properties[key]; | ||
345 | } | ||
346 | } else { | ||
347 | for (var key in properties) { | ||
348 | object[key] = properties[key]; | ||
349 | } | ||
337 | } | 350 | } |
338 | }}, | 351 | }}, |
339 | 352 | ||
@@ -760,7 +773,7 @@ var Deserializer = Montage.create(Montage, /** @lends module:montage/core/deseri | |||
760 | desc._units = {}; | 773 | desc._units = {}; |
761 | self._customDeserialization(object, desc); | 774 | self._customDeserialization(object, desc); |
762 | } else { | 775 | } else { |
763 | self._deserializeProperties(object, desc.properties); | 776 | self._deserializeProperties(object, desc.properties, false); |
764 | } | 777 | } |
765 | } | 778 | } |
766 | 779 | ||
@@ -784,7 +797,7 @@ var Deserializer = Montage.create(Montage, /** @lends module:montage/core/deseri | |||
784 | } else if ("@" in value) { | 797 | } else if ("@" in value) { |
785 | type = "reference"; | 798 | type = "reference"; |
786 | value = value["@"]; | 799 | value = value["@"]; |
787 | } else if (typeof value["->"] === "object") { | 800 | } else if ("->" in value) { |
788 | type = "function"; | 801 | type = "function"; |
789 | value = value["->"]; | 802 | value = value["->"]; |
790 | } else if ("." in value && Object.keys(value).length === 1) { | 803 | } else if ("." in value && Object.keys(value).length === 1) { |
@@ -1089,13 +1102,13 @@ var Deserializer = Montage.create(Montage, /** @lends module:montage/core/deseri | |||
1089 | /** | 1102 | /** |
1090 | @private | 1103 | @private |
1091 | */ | 1104 | */ |
1092 | _deserializeProperties: {value: function(object, properties) { | 1105 | _deserializeProperties: {value: function(object, properties, checkSerializableAttribute) { |
1093 | if (object.deserializeProperties) { | 1106 | if (object.deserializeProperties) { |
1094 | this._pushContextObject(properties); | 1107 | this._pushContextObject(properties); |
1095 | object.deserializeProperties(this); | 1108 | object.deserializeProperties(this); |
1096 | this._popContextObject(); | 1109 | this._popContextObject(); |
1097 | } else { | 1110 | } else { |
1098 | this.deserializePropertiesForObject(object, properties); | 1111 | this.deserializePropertiesForObject(object, properties, checkSerializableAttribute); |
1099 | } | 1112 | } |
1100 | }}, | 1113 | }}, |
1101 | 1114 | ||