Skip to content

Fix ES6 decorated class double binding.#6684

Merged
rbuckton merged 5 commits into
masterfrom
fixDecoratedClassName
Jan 30, 2016
Merged

Fix ES6 decorated class double binding.#6684
rbuckton merged 5 commits into
masterfrom
fixDecoratedClassName

Conversation

@rbuckton

Copy link
Copy Markdown
Contributor

Creates a class body scoped alias to the class to avoid class name double binding.

Fixes #5386.

@rbuckton rbuckton added this to the TypeScript 1.8 milestone Jan 28, 2016
Comment thread src/compiler/checker.ts Outdated

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.

getExportSymbolOfValueSymbolIfExported returns either a value that was initially passed or a merged symbol for an associated exported symbol so to me localSymbol is a bit misleading. In other places we call it similar values localOrExportedSymbol

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed.

Comment thread src/compiler/emitter.ts Outdated

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.

when declaration kind might not be ClassDeclaration? I think that if checker has set BodyScopedClassBinding flag it should be enough to state that referenced declaration is class

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added the BodyScopedClassBinding flag after adding this, and neglected to simplify the logic here.

@vladima

vladima commented Jan 28, 2016

Copy link
Copy Markdown
Contributor

👍 with a few suggestions

@mhegazy mhegazy removed this from the TypeScript 1.8 milestone Jan 28, 2016
rbuckton added a commit that referenced this pull request Jan 30, 2016
Fix ES6 decorated class double binding.
@rbuckton rbuckton merged commit fe23cc3 into master Jan 30, 2016
@rbuckton

Copy link
Copy Markdown
Contributor Author

Merged into master and cherry-picked into release-1.8.

@rbuckton rbuckton deleted the fixDecoratedClassName branch January 30, 2016 03:59
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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.

4 participants