Skip to content

add exported flag to declaration when default export - Fixes #393 #398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

nicknisi
Copy link
Collaborator

Add ReflectionFlag.Export flag to a node's flag variable when the export
converter is run and then check for that flag in createDeclaration.

This fixes a scenario described in #393 where export default is used in a separate
statement from the variable creation, such as:

const foo = 'bar';
export default foo;

In the above example, the export converter cannot find the symbolmapping
for the foo declaration because the createDeclaration code returns
null when --excludeNotExported flag is set.

Looking at the tests, it doesn't look like any of them run with excludeNoExport set, and setting it makes several fail. Setting excludeNoExport and running the export-default test does pass with this fix, though. I could try looking into that here, or perhaps as part of the proposed work in #378?

Add ReflectionFlag.Export flag to a node's flag variable when the export
converter is run.

This fixes a scenario where `export default` is used in a separate
statement from the variable creation, such as:

```
const foo = 'bar';
export default foo;
```

In the above example, the export converter cannot find the symbolmapping
for the `foo` declaration because the createDeclaration code returns
null when --excludeNotExported flag is set.
@nicknisi
Copy link
Collaborator Author

nicknisi commented Feb 8, 2017

Looking at this a bit more after I've had some time to dig into the TypeScript and TypeDoc code a bit more, and I think this might not be the best approach. I probably shouldn't be changing a Node's flags or adding a Reflection flag to it. I'll research a better approach.

@nicknisi
Copy link
Collaborator Author

Closing this PR. Will open a new one with a better solution to the problem.

@nicknisi nicknisi closed this Feb 22, 2017
@nicknisi nicknisi deleted the 393-default-export-flag branch February 22, 2017 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants