Giving names to method functions will cause unexpected variable in scope
I.e. Bublé will compile this:
function bar() { return 1 }
class Foo { bar() { return bar() } }
to this:
function bar() { return 1 }
var Foo = function Foo () {};
Foo.prototype.bar = function bar () { return bar() };
Which will cause a stack overflow as soon as you try to call bar
, since it ends up calling itself, rather than the function from the outer scope that it should be calling.
Solving this without breaking the name
property on the method is tricky (Babel generates some truly awful soup for this), but I think it's important. A pattern like the one above isn't too far fetched -- in fact, the ProseMirror build is currently broken because of exactly such a construct.