lib/class_manager.js
function(skeleton, class_data, padding, serialized_properties) {

		var name,
			serialized_value,
			uses_references = false,
			object_properties;

		for (name in skeleton) {

			switch (skeleton[name].type) {
				case this.MEMBER_TYPES.STRING:
					serialized_value = Firestorm.String.quote(skeleton[name].value);
					break;
				case this.MEMBER_TYPES.PRIMITIVE: // null, boolean, number
					serialized_value = skeleton[name].value + '';
					break;
				case this.MEMBER_TYPES.REGEXP:
				case this.MEMBER_TYPES.FUNCTION:
					serialized_value = 'r[' + skeleton[name].index + ']';
					uses_references = true;
					break;
				case this.MEMBER_TYPES.EMPTY_ARRAY:
					serialized_value = "[]";
					break;
				case this.MEMBER_TYPES.INLINE_ARRAY:
					serialized_value = this._serializeInlineArray(skeleton[name].value);
					break;
				case this.MEMBER_TYPES.SLICE_ARRAY:
					serialized_value = 'r[' + skeleton[name].index + '].slice()';
					uses_references = true;
					break;
				case this.MEMBER_TYPES.OBJECT:
					object_properties = [];
					if (this._serializeSkeleton(skeleton[name].skeleton, class_data, padding + "\t", object_properties)) {
						uses_references = true;
					}
					serialized_value = object_properties.length
						? "{\n\t" + padding + object_properties.join(",\n\t" + padding) + "\n" + padding + "}" : "{}";
					break;
				default:
					Lava.t("[_serializeSkeleton] unknown property descriptor type: " + skeleton[name].type);
			}

			if (Lava.VALID_PROPERTY_NAME_REGEX.test(name) && Lava.JS_KEYWORDS.indexOf(name) == -1) {

				serialized_properties.push(name + ': ' + serialized_value);

			} else {

				serialized_properties.push(Firestorm.String.quote(name) + ': ' + serialized_value);

			}

		}

		return uses_references;

	}
function(skeleton, class_data, padding, serialized_properties) {

		var name,
			serialized_value,
			uses_references = false,
			object_properties;

		for (name in skeleton) {

			switch (skeleton[name].type) {
				case this.MEMBER_TYPES.STRING:
					serialized_value = Firestorm.String.quote(skeleton[name].value);
					break;
				case this.MEMBER_TYPES.PRIMITIVE: // null, boolean, number
					serialized_value = skeleton[name].value + '';
					break;
				case this.MEMBER_TYPES.REGEXP:
				case this.MEMBER_TYPES.FUNCTION:
					serialized_value = 'r[' + skeleton[name].index + ']';
					uses_references = true;
					break;
				case this.MEMBER_TYPES.EMPTY_ARRAY:
					serialized_value = "[]";
					break;
				case this.MEMBER_TYPES.INLINE_ARRAY:
					serialized_value = this._serializeInlineArray(skeleton[name].value);
					break;
				case this.MEMBER_TYPES.SLICE_ARRAY:
					serialized_value = 'r[' + skeleton[name].index + '].slice()';
					uses_references = true;
					break;
				case this.MEMBER_TYPES.OBJECT:
					object_properties = [];
					if (this._serializeSkeleton(skeleton[name].skeleton, class_data, padding + "\t", object_properties)) {
						uses_references = true;
					}
					serialized_value = object_properties.length
						? "{\n\t" + padding + object_properties.join(",\n\t" + padding) + "\n" + padding + "}" : "{}";
					break;
				default:
					Lava.t("[_serializeSkeleton] unknown property descriptor type: " + skeleton[name].type);
			}

			if (Lava.VALID_PROPERTY_NAME_REGEX.test(name) && Lava.JS_KEYWORDS.indexOf(name) == -1) {

				serialized_properties.push(name + ': ' + serialized_value);

			} else {

				serialized_properties.push(Firestorm.String.quote(name) + ': ' + serialized_value);

			}

		}

		return uses_references;

	}
function ( skeleton , class_data , padding , serialized_properties ) { var name , serialized_value , uses_references = false , object_properties ; for ( name in skeleton ) { switch ( skeleton [ name ] . type ) { case this . MEMBER_TYPES . STRING : serialized_value = Firestorm . String . quote ( skeleton [ name ] . value ) ; break ; case this . MEMBER_TYPES . PRIMITIVE : // null, boolean, number serialized_value = skeleton [ name ] . value + '' ; break ; case this . MEMBER_TYPES . REGEXP : case this . MEMBER_TYPES . FUNCTION : serialized_value = 'r[' + skeleton [ name ] . index + ']' ; uses_references = true ; break ; case this . MEMBER_TYPES . EMPTY_ARRAY : serialized_value = "[]" ; break ; case this . MEMBER_TYPES . INLINE_ARRAY : serialized_value = this . _serializeInlineArray ( skeleton [ name ] . value ) ; break ; case this . MEMBER_TYPES . SLICE_ARRAY : serialized_value = 'r[' + skeleton [ name ] . index + '].slice()' ; uses_references = true ; break ; case this . MEMBER_TYPES . OBJECT : object_properties = [ ] ; if ( this . _serializeSkeleton ( skeleton [ name ] . skeleton , class_data , padding + "\t" , object_properties ) ) { uses_references = true ; } serialized_value = object_properties . length ? "{\n\t" + padding + object_properties . join ( ",\n\t" + padding ) + "\n" + padding + "}" : "{}" ; break ; default : Lava . t ( "[_serializeSkeleton] unknown property descriptor type: " + skeleton [ name ] . type ) ; } if ( Lava . VALID_PROPERTY_NAME_REGEX . test ( name ) && Lava . JS_KEYWORDS . indexOf ( name ) == - 1 ) { serialized_properties . push ( name + ': ' + serialized_value ) ; } else { serialized_properties . push ( Firestorm . String . quote ( name ) + ': ' + serialized_value ) ; } } return uses_references ; }
Perform special class serialization, that takes functions and resources from class data and can be used in constructors
@param {Object} skeleton
@param {_cClassData} class_data
@param {string} padding
@param {Array} serialized_properties
@returns {boolean} <kw>true</kw>, if object uses {@link _cClassData#references}
Perform special class serialization that takes functions and resources from class data and can be used in constructors