Skip to content

TypeScript incorrectly handles naughty strings in jsonΒ #53519

@Gabriel-Alves-Cunha

Description

@Gabriel-Alves-Cunha

Bug Report

πŸ”Ž Search Terms

bad naughty json string

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about bad strings in json

⏯ Playground Link

Playground link with relevant code

When you enter the playground, an alert message will appear:
image

Click at 'Cancel', otherwise, you'll not see the errors at the errors tab.

πŸ’» Code

Code here will tell you nothing, you should see the playground above. Don't worry, it's not complicated at all.

πŸ™ Actual behavior

There are several errors reported by the compiler, you can see them in the image below:
image

πŸ™‚ Expected behavior

I believe the compiler should be able to correctly handle these potencial problematic strings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions