Skip to content

Conversation

@plantain-00
Copy link
Contributor

Copy link
Member

Choose a reason for hiding this comment

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

<= ScriptTarget.ES5

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you wrap this in a helper method, since you repeat this pattern 3 times in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

The function name (emitVar) is misleading and we probably don't need the function at all.

I'd prefer to just have a local in this function const varOrConst = (languageVersion <= ScriptTarget.ES5) ? 'var ' : 'const ';) and write(varOrConst) at these call sites.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@RyanCavanaugh
Copy link
Member

👍

@paulvanbrenk
Copy link
Contributor

👍

Thanks!

DanielRosenwasser added a commit that referenced this pull request Jan 25, 2016
…hen_target_es6

Use const rather than var when target es6
@DanielRosenwasser DanielRosenwasser merged commit 6ff1bbe into microsoft:master Jan 25, 2016
@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.

5 participants