You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoiding rerunning ProcessDefines in J2clUtilGetDefineRewriterPass
The way `J2clUtilGetDefineRewriterPass` currently works is pretty messy as the
rerun of `ProcessDefines` does not work as one would expect. When we actually
rerun it all of the `goog.define` calls have already been removed, so the define
name is actually based on the name of the node annotated with `@define`.
Instead of doing this we can have `ProcessDefines` stash the name of all the
defines that it found. That's the only information that
`J2clUtilGetDefineRewriterPass` needs to operate, and no new defines are going
to be added along the way.
This does not change the requirement that the J2CL requires the define name to
match a `goog.provide` of the same name. Resolving that problem is quite a bit
more involved. For now this change just improves the improves the performance
and reduces the brittleness of the existing solution.
PiperOrigin-RevId: 700492292
0 commit comments