Skip to content

Don't intern all strings and numbers. Just the ones used as declaration names #2177

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
merged 4 commits into from
Mar 2, 2015

Conversation

CyrusNajmabadi
Copy link
Contributor

No description provided.

// "a['propname']" then we want to store "propname" in the name table.
if (isDeclarationName(node) ||
node.parent.kind === SyntaxKind.ExternalModuleReference ||
isArgumentOfElementAccessExpression(node)) {
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't you be more curious as to whether the element access is part of the LHS of an assignment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. For example, if you have:

foo(a['propname'])

we simply want to add 'propname' into the name table any time we see this, so we can effectively do 'Find All Refs' on a property called 'propname'.

@DanielRosenwasser
Copy link
Member

👍

CyrusNajmabadi added a commit that referenced this pull request Mar 2, 2015
Don't intern all strings and numbers.  Just the ones used as declaration names
@CyrusNajmabadi CyrusNajmabadi merged commit 0de61cb into master Mar 2, 2015
@CyrusNajmabadi CyrusNajmabadi deleted the intern branch March 2, 2015 22:36
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
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.

3 participants