-
-
Notifications
You must be signed in to change notification settings - Fork 496
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
refactor(transformer/class-properties): use duplicate_object
in transform_expression_to_wrap_nullish_check
#7664
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
duplicate_object
in transform_expression_to_wrap_nullish_check
This stack of pull requests is managed by Graphite. Learn more about stacking. |
duplicate_object
in transform_expression_to_wrap_nullish_check
duplicate_object
in transform_expression_to_wrap_nullish_check
CodSpeed Performance ReportMerging #7664 will not alter performanceComparing Summary
|
cd04ec0
to
f787b71
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.
Rebased on main and made a couple of small tweaks.
Merge activity
|
…ansform_expression_to_wrap_nullish_check` (#7664) The `duplicate_object` is great, it has handled unbound identifiers and `this` expressions, so we can remove a lot of code. But it is still a little bit annoying because we need two `object` here, although we can use `clone_in` it needs a special logic for `Expression::Identifier`.
f787b71
to
8883968
Compare
…od (#7685) Follow-up after #7664. Generalize `duplicate_object` to produce however many duplicates are required. Use it in `transform_expression_to_wrap_nullish_check`. This should be slightly more efficient, and will make it fool-proof if we expand `duplicate_object` later to handle other `Expression` types.
The
duplicate_object
is great, it has handled unbound identifiers andthis
expressions, so we can remove a lot of code. But it is still a little bit annoying because we need twoobject
here, although we can useclone_in
it needs a special logic forExpression::Identifier
.