Use JSON dictionary support to serialize Symbols and PlacedSymbol references.

This commit is contained in:
Jürg Lehni 2013-02-11 18:59:49 -08:00
parent 00dcd05549
commit e7bb334c6a
2 changed files with 8 additions and 0 deletions

View file

@ -20,6 +20,9 @@
*/
var PlacedSymbol = this.PlacedSymbol = PlacedItem.extend(/** @lends PlacedSymbol# */{
_type: 'placedsymbol',
_serializeFields: {
symbol: null
},
/**
* Creates a new PlacedSymbol Item.
*

View file

@ -68,6 +68,11 @@ var Symbol = this.Symbol = Base.extend(/** @lends Symbol# */{
this._instances = {};
},
_serialize: function(dictionary) {
return dictionary.get(this) || dictionary.set(this, [this._type,
Base.serialize(this._definition, false, dictionary)]);
},
// TODO: Symbol#remove()
// TODO: Symbol#name (accessible by name through project#symbols)