Open wojdyr opened 5 years ago
Whoa, I just came across this bug today.. It's a bit worse than reported, because buble is trying to hoist arguments
as if it were a normal variable. Check it out:
function myModule() {
myModule.hello = () => arguments.length;
myModule.goodbye = () => arguments.length;
return myModule;
}
function myModule() {
var arguments$1 = arguments;
myModule.hello = function () { return arguments$1.length; };
myModule.goodbye = function () { return arguments$1.length; };
return myModule;
}
Those really need to stay as arguments
and work locally for the methods.
Like #120, but for "arguments" instead of "this". Let me use the same example:
[Minimal example](https://buble.surge.sh/#function%20bar()%20%7B%0A%20%20while%20(true)%20arguments%3B%0A%7D):
Produces:
Expected output:
120 was fixed in #121, but I don't feel confident enough to propose a PR myself.