closure-compiler icon indicating copy to clipboard operation
closure-compiler copied to clipboard

Transpiled ES6 classes cannot extend non-transpiled ES6 classes

Open shicks opened this issue 8 years ago • 0 comments

While it's a non-goal of Closure Compiler to interoperate with code transpiled by different transpilers (there's simply no reliable way to guarantee this), it should at least be the case that transpiled code interoperates as well as possible with non-transpiled code, and this is currently not the case. Say we have ES6 classes Foo and Bar extends Foo defined in separate files foo.js and bar.js. If bar.js needs to be transpiled (say, due to using ES8 syntax) and foo.js does not, we end up with a transpiled class trying to extend a native class, and this is currently an error since we try to call the ES6 class without new.

This is related to #2098, but the problem is wider in scope.

We've been tracking this internally at b/36789413.

shicks avatar May 15 '17 19:05 shicks