Skip to content

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 mhegazy and rbuckton 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
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
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.

2 participants