-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
feat(es/transform): introduce NodeIgnoringSpan
#7030
Conversation
impl<'a, Node: EqIgnoreSpan + ToOwned + Debug> Eq for NodeIgnoringSpan<'a, Node> {} | ||
|
||
// TODO: This only a workaround for Expr. we need something like | ||
// `hash_ignore_span` for each node in the end. |
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.
I think we need hash_ignore_span
in the end if we want to make this implementation energetic.
And the code could be rewritten like
impl<'a, Node: HashIgnoreSpan> Hash for NodeIgnoringSpan<'a, Node> {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.hash_ignore_span(state)
}
}
}
However, I think this could be done in another PR.
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.
Thank you!
swc-bump:
- swc_ecma_utils
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.
Thank you!
swc-bump:
- swc_ecma_utils
- swc_ecma_transforms_optimization --breaking
Description:
NodeIgnoringSpan
, which will ignoreSpan
while doingeq
orhash
.InlineGlobals
.BREAKING CHANGE:
Related issue (if exists):