Skip to content
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

String.fromCodePoint fails when the input is negative #17

Open
sozysozbot opened this issue Apr 4, 2022 · 0 comments
Open

String.fromCodePoint fails when the input is negative #17

sozysozbot opened this issue Apr 4, 2022 · 0 comments

Comments

@sozysozbot
Copy link
Contributor

While String.fromCodePoint is handled in L341-345,

pietron/src/debug.js

Lines 341 to 345 in f8ce860

try {
return i > 31 ? String.fromCodePoint(i) : '??';
} catch (error) {
return '??';
}

it is not handled in L249-251.

pietron/src/debug.js

Lines 249 to 251 in f8ce860

if (lessThan(1)) break;
output += String.fromCodePoint(stack.pop());
break;

This causes Pietron to fail:
invalid_code_point

In my opinion, invalid code points qualify as "operations which cannot be performed", and hence should be ignored.

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

1 participant