diff options
author | Jose Antonio Marquez | 2012-05-16 15:42:37 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-05-16 15:42:37 -0700 |
commit | 857aafee732b6a85fa155ff4a05d1b8fde48f09d (patch) | |
tree | e06d330caee280aa05aec46391979e9abdcf974c /node_modules/montage/core/serializer.js | |
parent | 5cc5d29736d8bf253e3a168cdd6443e839ffb23c (diff) | |
parent | fd54dabad7cbc27a0efb0957155c00d578912909 (diff) | |
download | ninja-857aafee732b6a85fa155ff4a05d1b8fde48f09d.tar.gz |
Merge branch 'refs/heads/Ninja-DOM-Architecture' into Document
Diffstat (limited to 'node_modules/montage/core/serializer.js')
-rwxr-xr-x | node_modules/montage/core/serializer.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/node_modules/montage/core/serializer.js b/node_modules/montage/core/serializer.js index ba2fa04a..72543328 100755 --- a/node_modules/montage/core/serializer.js +++ b/node_modules/montage/core/serializer.js | |||
@@ -89,7 +89,8 @@ var Serializer = Montage.create(Montage, /** @lends module:montage/serializer.Se | |||
89 | value: function(objects) { | 89 | value: function(objects) { |
90 | var serialization, | 90 | var serialization, |
91 | valueSerialization, | 91 | valueSerialization, |
92 | label; | 92 | label, |
93 | serializeNullValues = this.serializeNullValues; | ||
93 | 94 | ||
94 | this._serializedObjects = {}; | 95 | this._serializedObjects = {}; |
95 | this._serializedReferences = {}; | 96 | this._serializedReferences = {}; |
@@ -100,14 +101,18 @@ var Serializer = Montage.create(Montage, /** @lends module:montage/serializer.Se | |||
100 | this._objectReferences = {}; | 101 | this._objectReferences = {}; |
101 | 102 | ||
102 | for (label in objects) { | 103 | for (label in objects) { |
103 | this._objectLabels[objects[label].uuid] = label; | 104 | if (objects[label] != null) { |
105 | this._objectLabels[objects[label].uuid] = label; | ||
106 | } | ||
104 | } | 107 | } |
105 | 108 | ||
106 | for (label in objects) { | 109 | for (label in objects) { |
107 | valueSerialization = this._serializeValue(objects[label], null, 2); | 110 | if (objects[label] != null || serializeNullValues) { |
108 | // objects are automatically inserted as top level objects after calling _serializeValue, but native objects have to be manually inserted them. | 111 | valueSerialization = this._serializeValue(objects[label], null, 2); |
109 | if (!(label in this._serializedObjects)) { | 112 | // objects are automatically inserted as top level objects after calling _serializeValue, but native objects have to be manually inserted them. |
110 | this._serializedObjects[label] = {value: valueSerialization}; | 113 | if (!(label in this._serializedObjects)) { |
114 | this._serializedObjects[label] = {value: valueSerialization}; | ||
115 | } | ||
111 | } | 116 | } |
112 | } | 117 | } |
113 | 118 | ||
@@ -653,6 +658,7 @@ var Serializer = Montage.create(Montage, /** @lends module:montage/serializer.Se | |||
653 | return this._serializeValue(objectDescriptor.value); | 658 | return this._serializeValue(objectDescriptor.value); |
654 | } else { | 659 | } else { |
655 | objectDescriptor.properties = this._serializeObjectLiteral(objectDescriptor.properties, null, 3); | 660 | objectDescriptor.properties = this._serializeObjectLiteral(objectDescriptor.properties, null, 3); |
661 | var units; | ||
656 | if (units = /* assignment */ objectDescriptor._units) { | 662 | if (units = /* assignment */ objectDescriptor._units) { |
657 | delete objectDescriptor._units; | 663 | delete objectDescriptor._units; |
658 | this._applySerializationUnits(objectDescriptor, object, units); | 664 | this._applySerializationUnits(objectDescriptor, object, units); |