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 }}
This repository was archived by the owner on Feb 1, 2025. It is now read-only.
Regenerator runtime breaks when code is minified with UglifyJS that removes the function name GeneratorFunction, because the code checks for the Function#name and throws if it does not match:
The check exists to make sure regeneratorRuntime.isGeneratorFunction will work. I realize it's annoying that you can't just use UglifyJS without taking care to protect GeneratorFunction from being renamed, but that's the way it has to be, unless we use eval or Function to create GeneratorFunction, but that's a CSP violation.
Edit: I regret the tone of the following sentence, and would like to delete it, but it feels dishonest to hide my tracks like that. Please disregard.
I'll consider fixing this some other way if @sebmck agrees to stop storing modified Regenerator source files in his repository: babel/babel#313
I definitely should have looped you in there; I don't like the idea of 6to5 maintaining its own runtime. It would be totally redundant. I was under some pressure just to get something working at that point.
The problem is that you can't use uglify at all right now, see mishoo/UglifyJS#552. It's totally Uglify's fault because it strips the names of function expressions and there's no way to turn that off, which is stupid. If you change the code to be:
Regenerator runtime breaks when code is minified with UglifyJS that removes the function name
GeneratorFunction
, because the code checks for theFunction#name
and throws if it does not match:Similar issue (babel/babel#283) in 6to5 that uses regenerator runtime was fixed by removing the check: babel/babel@c92fd6f
The text was updated successfully, but these errors were encountered: