lib/packages/core.js
function(top_resources, bottom_resources) {

		var name,
			result = Firestorm.Object.copy(top_resources);

		for (name in bottom_resources) {

			if (name in result) {

				if (Lava.schema.DEBUG && result[name].type != bottom_resources[name].type) Lava.t("Resource types mismatch: " + name);

				if (bottom_resources[name].type == 'component') {

					result[name] = {
						type: 'component',
						value: this.mergeResources(result[name].value, bottom_resources[name].value)
					};

				} else if (bottom_resources[name].type == 'container_stack') {

					if (result[name].type != 'container_stack') Lava.t();

					result[name] = {
						type: 'container_stack',
						value: bottom_resources[name].value.concat(result[name].value)
					}

				}

			} else {

				result[name] = bottom_resources[name];

			}

		}

		return result;

	}
function(top_resources, bottom_resources) {

		var name,
			result = Firestorm.Object.copy(top_resources);

		for (name in bottom_resources) {

			if (name in result) {

				if (Lava.schema.DEBUG && result[name].type != bottom_resources[name].type) Lava.t("Resource types mismatch: " + name);

				if (bottom_resources[name].type == 'component') {

					result[name] = {
						type: 'component',
						value: this.mergeResources(result[name].value, bottom_resources[name].value)
					};

				} else if (bottom_resources[name].type == 'container_stack') {

					if (result[name].type != 'container_stack') Lava.t();

					result[name] = {
						type: 'container_stack',
						value: bottom_resources[name].value.concat(result[name].value)
					}

				}

			} else {

				result[name] = bottom_resources[name];

			}

		}

		return result;

	}
function ( top_resources , bottom_resources ) { var name , result = Firestorm . Object . copy ( top_resources ) ; for ( name in bottom_resources ) { if ( name in result ) { if ( Lava . schema . DEBUG && result [ name ] . type != bottom_resources [ name ] . type ) Lava . t ( "Resource types mismatch: " + name ) ; if ( bottom_resources [ name ] . type == 'component' ) { result [ name ] = { type : 'component' , value : this . mergeResources ( result [ name ] . value , bottom_resources [ name ] . value ) } ; } else if ( bottom_resources [ name ] . type == 'container_stack' ) { if ( result [ name ] . type != 'container_stack' ) Lava . t ( ) ; result [ name ] = { type : 'container_stack' , value : bottom_resources [ name ] . value . concat ( result [ name ] . value ) } } } else { result [ name ] = bottom_resources [ name ] ; } } return result ; }
Merge resource objects.
`top_resources` is expected to be a copy or a new empty object.
Properties in `top_resources` have priority over `bottom_resources`

@param {Object} top_resources Child resources
@param {Object} bottom_resources Parent resources
Merge resource objects . top_resources is expected to be a copy or a new empty object . Properties in top_resources have priority over bottom_resources