diff options
author | Armen Kesablyan | 2012-06-19 01:03:59 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-19 01:03:59 -0700 |
commit | 2e13a73e4ee980a6f73f6ff48b2a195eb209a7db (patch) | |
tree | d352f5e769eae0e1b7b76ccbeafa9b174b1a9918 /node_modules/montage/core/deserializer.js | |
parent | 244e608645778746d1a3b5aa0d4c0868f7c5c272 (diff) | |
parent | c59eb371559a3061ce53223e249ca97daace5968 (diff) | |
download | ninja-2e13a73e4ee980a6f73f6ff48b2a195eb209a7db.tar.gz |
Merge branch 'refs/heads/master' into binding
Conflicts:
js/components/layout/tools-list.reel/tools-list.html
js/components/layout/tools-properties.reel/tools-properties.html
js/document/document-html.js
js/document/templates/app/main.js
js/panels/Panel.reel/Panel.js
node_modules/montage/ui/native-control.js
Signed-off-by: Armen Kesablyan <armen@motorola.com>
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 | ||