Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add getOrUpdate helper#10436

Closed
ghost wants to merge 2 commits into
mastermicrosoft/TypeScript:masterfrom
getOrUpdatemicrosoft/TypeScript:getOrUpdateCopy head branch name to clipboard
Closed

Add getOrUpdate helper#10436
ghost wants to merge 2 commits into
mastermicrosoft/TypeScript:masterfrom
getOrUpdatemicrosoft/TypeScript:getOrUpdateCopy head branch name to clipboard

Conversation

@ghost

@ghost ghost commented Aug 19, 2016

Copy link
Copy Markdown

No description provided.

@ghost ghost force-pushed the getOrUpdate branch from 38b6195 to e0e5afc Compare August 19, 2016 14:39
@ghost ghost assigned rbuckton Aug 19, 2016
Comment thread src/compiler/binder.ts Outdated
// you have multiple 'vars' with the same name in the same container). In this case
// just add this node into the declarations list of the symbol.
symbol = symbolTable[name] || (symbolTable[name] = createSymbol(SymbolFlags.None, name));
symbol = getOrUpdate(symbolTable, name, () => createSymbol(SymbolFlags.None, name));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oddly enough, I had removed this exact function to avoid the closure on this line.

@mhegazy

mhegazy commented Sep 14, 2016

Copy link
Copy Markdown
Contributor

what is the reason for this change?

@ghost

ghost commented Sep 15, 2016

Copy link
Copy Markdown
Author

Just a pattern I noticed while going through uses of maps.

@ghost

ghost commented Oct 7, 2016

Copy link
Copy Markdown
Author

This is now part of #11354

@ghost ghost closed this Oct 7, 2016
@mhegazy mhegazy deleted the getOrUpdate branch November 2, 2017 21:03
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.