Which throws at runtime. Overall problem is that the template returns an AssignmentExpression which is used in this code as a VariableDeclarator which confuses babel.
A clean fix would be to check if the scope of declarations is already wrapped but that is not trivial (as is wrapping/removing unused references anyway) and I wanted this fix to be as simple as possible to fix mui-org/material-ui#13245
Without the fix the new test case for
*-wrap-es5
would transpile toWhich throws at runtime. Overall problem is that the template returns an
AssignmentExpression
which is used in this code as aVariableDeclarator
which confuses babel.A clean fix would be to check if the scope of declarations is already wrapped but that is not trivial (as is wrapping/removing unused references anyway) and I wanted this fix to be as simple as possible to fix mui-org/material-ui#13245