Skip to content

Instantly share code, notes, and snippets.

@Retsam
Last active Aug 29, 2015
Embed
What would you like to do?
BabelJS Bug
//Expected output: A B C (see http://www.es6fiddle.net/ice1qchm/)
//Actual output from Babel: A C
//ES5 legacy code
function A () {
console.log("A");
}
function B () {
A.call(this);
console.log("B");
}
B.prototype = Object.create(A.prototype);
B.constructor = B;
//ES6 code
class C extends B {
constructor(data) {
super({}); //Should call B(), no?
console.log("C");
}
}
new C();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment