Last active
August 29, 2015 14:25
-
-
Save Retsam/649cc922b61b110c85d2 to your computer and use it in GitHub Desktop.
BabelJS Bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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