-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Repl fails to parse some json inputs #12447
Comments
Might be related to #10542 |
For reference, adding |
Yeah, this looks like a combination of bugs in our object formatting code, and REPL code. Running this code demonstrates what is going on pretty well: console.log(JSON.parse(`["98 chars", "${"x".repeat(98)}🌎"]`));
console.log(JSON.parse(`["99 chars", "${"x".repeat(99)}🌎"]`));
console.log(JSON.parse(`["100 chars", "${"x".repeat(100)}🌎"]`));
The formatted splits multi byte unicode chars in half. We need to do two things: a) update formatting code to not chop multi byte characters in half I'll keep this issue for a), while b) is already tracked in #12226 |
the issue seems fixed in the latest version, the reproduction code doesn't error anymore |
Trying this line in the repl
fails with
Unterminated string literal
It only fails if there is exactly 99 'a' (or any character) before the world unicode
If I add or remove a couple of characters before the unicode it works.
meta:
deno 1.14.3 (release, x86_64-unknown-linux-gnu)
v8 9.4.146.19
typescript 4.4.2
The text was updated successfully, but these errors were encountered: