Closed ClassicOldSong closed 6 years ago
codemirror also uses array transposition which Buble does not handle:
[from, to] = [to, from]
[1]
EDIT: sorry, don't mean to hijack.
Same Here. For example:
class A {
constructor () {
this.a = [1,2]
this.funcA()
}
funcA () {
console.log('Ops!')
this.a.splice(0, 0, ...this.a)
}
}
let a = new A()
will transform to
var A = function A () {
this.a = [1,2]
this.funcA()
};
A.prototype.funcA = function funcA () {
var ref;
console.log('Ops!')
(ref = this.a).splice.apply(ref, [ 0, 0 ].concat( this.a ))
};
var a = new A()
This will lead to an error console.log(...) is not a function
which is not expected.
Duplicate of https://github.com/Rich-Harris/buble/issues/87
Previous issue: https://gitlab.com/Rich-Harris/buble/issues/192
Expected:
Actually happening:
Live example