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
{{ message }}
Repository navigation
[7.0] Investigate what would be needed to remove the shadow-function.js internal plugin #5597
This plugin is ugly and requires us to tack private undocumented properties onto AST nodes so that this and arguments are handled properly when processing scopes.
Ideally the rewriting and hoisting of these values would be handled by some helper that was used by all of the places we need to normalize these values. We should investigate what if anything might be blocking us from doing that.
The primary thing that comes to mind is that when we transform these things, we need to take into account anything that might care about this in those contexts. e.g.
async fn(){
super.fn();
}
when rewriting, we have to move the function content inside of a wrapper, which breaks super.
var fn = function(){
return (...args) => arguments;
}
When converting this arrow to a function, we need to rewrite arguments.
I think this is doable, but we'll need to keep plugin ordering in mind. The super case above for instance is a bug we currently have that I think is fixable easily if we do this.
Activity