Skip to content

[Not really a bug] change in es5 output from string interpolation #48776

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

Closed
bigopon opened this issue Apr 20, 2022 · 2 comments
Closed

[Not really a bug] change in es5 output from string interpolation #48776

bigopon opened this issue Apr 20, 2022 · 2 comments

Comments

@bigopon
Copy link

bigopon commented Apr 20, 2022

Bug Report

πŸ”Ž Search Terms

string concat

πŸ•— Version & Regression Information

4.5.x

  • This is not a crash
  • This changed between versions 4.4.x and 4.5.x

⏯ Playground Link

https://www.typescriptlang.org/play?target=1&ts=4.5.5#code/G4QwTgBCELwQBgEgN4CMC+AHAHvIA

πŸ’» Code

var a = `${b}px`

πŸ™ Actual behavior

output:

"use strict";
var a = "".concat(b, "px");

πŸ™‚ Expected behavior

"use strict";
var a = b + "px";
@Josh-Cena
Copy link
Contributor

This is expected. See #45304

@bigopon
Copy link
Author

bigopon commented Apr 20, 2022

@Josh-Cena I see. thanks for the pointer. I guess if anyone is concerned by .concat(), they can use + instead of template literal.

@bigopon bigopon closed this as completed Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants