-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
fix(core): panic on big string allocation #7395
fix(core): panic on big string allocation #7395
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm
Good to see this fixed but IMO returning an empty string is a really weird response - why not throw a RangeTypeError?
I actually wonder if this might be a bug in Chrome rather than intentional behavior. I could see that happen because of a weird quirk in the v8 api, which is that when a V8 API function returns an empty MaybeLocal this always means a JS exception was thrown. With one exception: v8::String::new() can also return an empy MaybeLocal but in that case it just means the string was too long.
@piscisaureus thanks for pointing this, indeed spec suggests to use |
90c4813
to
22a2bd8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a change of heart, switched it to RangeError after all, and made some minor tweaks to the doc comment.
Now it looks good to me.
Fixes #6649