(node)
| 47179 | } |
| 47180 | } |
| 47181 | function bindModuleExportsAssignment(node) { |
| 47182 | // A common practice in node modules is to set 'export = module.exports = {}', this ensures that 'exports' |
| 47183 | // is still pointing to 'module.exports'. |
| 47184 | // We do not want to consider this as 'export=' since a module can have only one of these. |
| 47185 | // Similarly we do not want to treat 'module.exports = exports' as an 'export='. |
| 47186 | if (!setCommonJsModuleIndicator(node)) { |
| 47187 | return; |
| 47188 | } |
| 47189 | var assignedExpression = ts.getRightMostAssignedExpression(node.right); |
| 47190 | if (ts.isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { |
| 47191 | return; |
| 47192 | } |
| 47193 | if (ts.isObjectLiteralExpression(assignedExpression) && ts.every(assignedExpression.properties, ts.isShorthandPropertyAssignment)) { |
| 47194 | ts.forEach(assignedExpression.properties, bindExportAssignedObjectMemberAlias); |
| 47195 | return; |
| 47196 | } |
| 47197 | // 'module.exports = expr' assignment |
| 47198 | var flags = ts.exportAssignmentIsAlias(node) |
| 47199 | ? 2097152 /* SymbolFlags.Alias */ |
| 47200 | : 4 /* SymbolFlags.Property */ | 1048576 /* SymbolFlags.ExportValue */ | 512 /* SymbolFlags.ValueModule */; |
| 47201 | var symbol = declareSymbol(file.symbol.exports, file.symbol, node, flags | 67108864 /* SymbolFlags.Assignment */, 0 /* SymbolFlags.None */); |
| 47202 | ts.setValueDeclaration(symbol, node); |
| 47203 | } |
| 47204 | function bindExportAssignedObjectMemberAlias(node) { |
| 47205 | declareSymbol(file.symbol.exports, file.symbol, node, 2097152 /* SymbolFlags.Alias */ | 67108864 /* SymbolFlags.Assignment */, 0 /* SymbolFlags.None */); |
| 47206 | } |
no test coverage detected