-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
[Merged by Bors] - Removed some duplicate code, added ToIndentedString
#2367
Conversation
Test262 conformance changes
|
Codecov Report
@@ Coverage Diff @@
## main #2367 +/- ##
==========================================
- Coverage 39.88% 39.84% -0.05%
==========================================
Files 243 243
Lines 23293 23318 +25
==========================================
Hits 9290 9290
- Misses 14003 14028 +25
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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 like a great change to me!
Concerning contains
and contains_arguments
, I think we should leave those as-is for now. I had the idea of maybe generating the results at parse time and writing them into the AST so that we do not have to walk the AST every time we call those functions. I did not look at it seriously, but If something like that works out, we could remove all of those functions.
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.
LGTM, nothing to note
5e78eda
to
f66ade8
Compare
re-based :) |
bors r+ |
In most cases, the `ToInternedString` was just calling `self.to_indented_string(interner, 0)`. This avoids all this duplicate code by adding a new trait, `ToIndentedString`. Any type implementing that automatically implements `ToInternedString`. I have also added a bunch of `#[inline]` in one-liners, and some one-line documentations for some functions. I have noticed that we also use `contains()` and `contains_arguments()` a lot. Would it make sense to create traits for this?
Pull request successfully merged into main. Build succeeded:
|
ToIndentedString
ToIndentedString
In most cases, the
ToInternedString
was just callingself.to_indented_string(interner, 0)
. This avoids all this duplicate code by adding a new trait,ToIndentedString
. Any type implementing that automatically implementsToInternedString
.I have also added a bunch of
#[inline]
in one-liners, and some one-line documentations for some functions.I have noticed that we also use
contains()
andcontains_arguments()
a lot. Would it make sense to create traits for this?