Skip to content

Allow isSymbolAccessible to paint object literal declarations as visible #24668

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

Merged

Conversation

weswigham
Copy link
Member

@weswigham weswigham commented Jun 4, 2018

In this PR I've modified isSymbolAccessible to recognize var a = { ... } as something that allows us to possibly reference the members of the object literal in the initializer (allowing the example to generate a declaration file without error, as suggested in the associated issue).

Fixes #24632

…on - use checkExpression and resolvedSymbol instead
@weswigham weswigham requested review from rbuckton and mhegazy June 4, 2018 21:31
symbol = getContainerOfSymbol(symbol);
const container = getContainerOfSymbol(symbol);
// If we're trying to reference some object literal in, eg `var a = { x: 1 }`, the symbol for the literal, `__object`, is distinct
// from the symbol of the declaration it is beign assigned to. Since we can use the declaration to refer to the literal, however,
Copy link
Member

Choose a reason for hiding this comment

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

Typo beign -> being

Copy link
Member

@RyanCavanaugh RyanCavanaugh left a comment

Choose a reason for hiding this comment

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

LGTM; please merge after resolving conflicts

@weswigham weswigham changed the title Dont use resolveEntityName for computed property name symbol resolution Allow isSymbolAccessible to paint object literal declarations as visible Sep 5, 2018
@weswigham weswigham merged commit 0b1183a into microsoft:master Sep 5, 2018
@weswigham weswigham deleted the no-computed-name-namespace-error branch September 5, 2018 21:52
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.

2 participants