Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Jan 22, 2018

First stab at #20793
At each definition of exportingModuleSymbol, asserts that it's defined.
Uses a helper function from #21339.

if (node.kind === SyntaxKind.DefaultKeyword) {
addReference(node, symbol, node, state);
searchForImportsOfExport(node, symbol, { exportingModuleSymbol: symbol.parent, exportKind: ExportKind.Default }, state);
searchForImportsOfExport(node, symbol, { exportingModuleSymbol: Debug.assertDefined(symbol.parent), exportKind: ExportKind.Default }, state);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a message to the assert.

// Get the symbol for the `export =` node; its parent is the module it's the export of.
const exportingModuleSymbol = ex.symbol.parent;
Debug.assert(!!exportingModuleSymbol);
const exportingModuleSymbol = Debug.assertDefined(ex.symbol.parent);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this one too

@ghost ghost merged commit 78f217b into master Feb 2, 2018
@ghost ghost deleted the assertExportingModuleSymbolDefined branch February 2, 2018 18:49
@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant