-
-
Notifications
You must be signed in to change notification settings - Fork 400
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 some panics in String.prototype properties #888
Conversation
Codecov Report
@@ Coverage Diff @@
## master #888 +/- ##
==========================================
+ Coverage 59.30% 59.79% +0.48%
==========================================
Files 165 165
Lines 10383 10410 +27
==========================================
+ Hits 6158 6225 +67
+ Misses 4225 4185 -40
Continue to review full report at Codecov.
|
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.
Looks good to me, but check my comment to see if we can improve performance a little bit.
boa/src/builtins/string/mod.rs
Outdated
let end = args | ||
.get(1) | ||
.expect("failed to get argument in slice") | ||
.unwrap_or(&Value::integer(length)) |
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.
Wouldn't this be more performant if it used unwrap_or_else()
?
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.
Right, done
These changes address the
failed to get argument for String method
panics documented in #817.