google / google/closure-compiler

Transpiled ES6 classes cannot extend non-transpiled ES6 classes

Open
#2,494 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

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](http://b/36789413).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.