function collectShortcuts(factory) {
	const body = factory.body;

	function checkAssignment(name, valueNode) {
		valueNode = resolvePotentialWrapperExpression(valueNode);

		if ( valueNode.type === Syntax.Literal ) {
			currentModule.localNames[name] = {
				value: valueNode.value,
				raw: valueNode.raw
			};
			debug("compile time constant found ", name, valueNode.value);
		} else if ( isMemberExpression(valueNode) ) {
			const _import = getLeftmostName(valueNode);
			const local = _import && currentModule.localNames[_import];
			const objectName = getObjectName(valueNode);
			if ( objectName && typeof local === 'object' && local.module ) {
				currentModule.localNames[name] = {
					module: local.module,
					path: objectName.split('.').slice(1).join('.') // TODO chaining if local has path
				};
				debug(`  found local shortcut: ${name} ${currentModule.localNames[name]}`);
			}
		} else if ( isRequireSyncCall(valueNode) || isProbingRequireCall(valueNode) ) {
			if ( valueNode.arguments[0] && isStringLiteral(valueNode.arguments[0]) ) {
				currentModule.localNames[name] = {
					module: convertValue(valueNode.arguments[0])
					// no (or empty) path
				};
				debug(`  found local import: ${name} = ${valueNode.callee.property.name}('${valueNode.arguments[0].value}')`);
			}
		} else if ( isExtendCall(valueNode) ) {
			currentModule.localNames[name] = {
				"class": valueNode.arguments[0].value
				// no (or empty) path
			};
			debug(`  found local class definition: ${name} = .extend('${valueNode.arguments[0].value}', ...)`);
		}
	}

	if ( body.type === Syntax.BlockStatement || isArrowFuncExpression(factory) ) {
		const itemsResolver = function ( stmt ) {
			// console.log(stmt);
			if ( stmt.type === Syntax.FunctionDeclaration ) {
				if ( stmt.id && stmt.id.type === Syntax.Identifier && stmt.loc && stmt.loc.start ) {
					const loc = stmt.loc.start.line + ":" + stmt.loc.start.column;
					currentModule.localNamesByLoc[loc] =
					currentModule.localNames[stmt.id.name] = {
						"function": stmt
					};
				}
			} else if ( stmt.type === Syntax.VariableDeclaration ) {
				stmt.declarations.forEach((decl) => {
					if ( decl.init ) {
						checkAssignment(decl.id.name, decl.init);
					}
				});
			} else if ( stmt.type === Syntax.ExpressionStatement
						&& stmt.expression.type === Syntax.AssignmentExpression
						&& stmt.expression.left.type === Syntax.Identifier ) {
				checkAssignment(stmt.expression.left.name, stmt.expression.right);
			} else if ( isReturningNode(stmt) ) {
				const stmtArgument = isArrowFuncExpression(stmt)
					? stmt.body
					: resolvePotentialWrapperExpression(stmt).argument;

				if ( stmtArgument && stmtArgument.type === Syntax.Identifier ) {
					currentModule.defaultExport = stmtArgument.name;
				} else if ( stmtArgument && stmtArgument.type === Syntax.ClassExpression && stmtArgument.id && stmtArgument.id.type === Syntax.Identifier ) {
					debug(`  found default export class definition: return class '${stmtArgument.id.name}'`);
					currentModule.defaultExportClass = stmtArgument.id.name;
				} else if ( stmtArgument && isExtendCall(stmtArgument) ) {
					debug(`  found default export class definition: return .extend('${stmtArgument.arguments[0].value}', ...)`);
					currentModule.defaultExportClass = convertValue(stmtArgument.arguments[0]);
				}
			}
		};

		if (isArrowFuncExpression(factory)) {
			itemsResolver(factory);
		} else {
			body.body.forEach(itemsResolver);
		}
	}

	if ( currentModule.defaultExport && currentModule.localNames[currentModule.defaultExport] ) {
		currentModule.localNames[currentModule.defaultExport].export = "";
	}
}
Searches the body of the given factory for variable declarations that can be evaluated statically,
either because they refer to known AMD module imports (e.g. shortcut variables)
or because they have a (design time) constant value.

@param {ASTNode} factory AST node of a factory function whose body that shall be searched for shortcuts