Skip to content

String Interpolation error with escaped strings #20192

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
Proculopsis opened this issue Nov 21, 2017 · 8 comments
Closed

String Interpolation error with escaped strings #20192

Proculopsis opened this issue Nov 21, 2017 · 8 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@Proculopsis
Copy link

Full example here in the Playground: https://goo.gl/VWEkV5

The transpiler isn't consistent with native JavaScript when using the escaping character.

For example:

\0 == "\0" but \0000 != "\0000"

@DanielRosenwasser DanielRosenwasser added the Bug A bug in TypeScript label Nov 21, 2017
@DanielRosenwasser
Copy link
Member

This is either a bug or a symptom/duplicate of #396.

@DanielRosenwasser DanielRosenwasser added this to the TypeScript 2.7 milestone Nov 21, 2017
@mhegazy mhegazy modified the milestones: TypeScript 2.7, Community Nov 21, 2017
@mhegazy mhegazy added the Help Wanted You can do this label Nov 21, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Nov 21, 2017

PRs appreciated.

@Kingwl
Copy link
Contributor

Kingwl commented Dec 1, 2017

ping @mhegazy and @DanielRosenwasser
what is the correct behavior?

@chuckjaz
Copy link
Contributor

This affects ts.createLiteral() in transformers as well.

I wouldn't mind giving a crack at a PR if you can direct me to the cases that the escapeString() was trying to address.

@weswigham
Copy link
Member

@chuckjaz what's your specific problem? That transpiled strings get rewritten at all, or a problem with their meaning? We recently fixed a bug to do with octals in transpiled strings which may cover your problem?

@weswigham
Copy link
Member

Yeah, #22335 may have fixed this; #21828 probably should have been marked as a dupe of this.

@chuckjaz
Copy link
Contributor

That appears to be the fix we need, we were running into the d2 case from #21828. The linked issue from our repository has a PR we are landing to work around the issue in 2.6 and 2.7. Is this landing in a point release for 2.7 or waiting until 2.8?

@weswigham
Copy link
Member

It should be in the 2.8 RC, I believe, whenever that goes out (if it hasn't already).

@weswigham weswigham added Fixed A PR has been merged for this issue and removed Help Wanted You can do this labels Mar 15, 2018
@weswigham weswigham modified the milestones: Community, TypeScript 2.8 Mar 15, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

6 participants