test(transformer/class-properties): more testing for assignment to super[prop]#7992
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Just a thought for the future... We could also reduce size of output by adding more helpers. e.g.:
Then no temp vars required at all. Same thing for lots of other transforms which currently produce very long output.
|
Yes, this is a good direction to reduce size of the transformation output |
Merge activity
|
…uper[prop]` (#7992) Amend test added in #7991 to test transform of `super[prop] = value` where `prop` is not bound. We should ideally have the `_unbound` temp vars *inside* the arrow function rather than outside, as Babel does, but that's not possible with our double-visitor scheme at present, and I think current output will operate correctly anyway. Probably these temp vars could be hoisted even higher up - to very top level of the file, even if the class and `super[prop]` were deeply nested in many functions - and it'd still be correct. That'd be good for transformer performance as less `var` statements to insert, and also slightly smaller output size - less `var`s in code. But I don't know if that would be worse for runtime performance, as it makes the arrow function more impure. 🤔
e9af5ee to
5cf253c
Compare

Amend test added in #7991 to test transform of
super[prop] = valuewherepropis not bound.We should ideally have the
_unboundtemp vars inside the arrow function rather than outside, as Babel does, but that's not possible with our double-visitor scheme at present, and I think current output will operate correctly anyway.Probably these temp vars could be hoisted even higher up - to very top level of the file, even if the class and
super[prop]were deeply nested in many functions - and it'd still be correct. That'd be good for transformer performance as lessvarstatements to insert, and also slightly smaller output size - lessvars in code. But I don't know if that would be worse for runtime performance, as it makes the arrow function more impure. 🤔