Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong output for arrow function returning class that extends argument #150

Closed
chge opened this issue Sep 6, 2018 · 0 comments
Closed

Wrong output for arrow function returning class that extends argument #150

chge opened this issue Sep 6, 2018 · 0 comments
Labels

Comments

@chge
Copy link

chge commented Sep 6, 2018

The following code:

const f = (b) => class a extends b {};

Produces the following incorrect output:

var f = function (b) (function (b) {
// ... the rest is correct

Possible workaround is to use parentheses:

const f = (b) => (class a extends b {});

...or to to use ordinary function:

const f = function(b) { return class a extends b {}; };

Caught this while trying to transpile asn.js with such syntax.

chge added a commit to chge/ASN1.js that referenced this issue Sep 6, 2018
This quick'n'dirty fix allows dependents to use Bublé transpiler: bublejs/buble#150
chge added a commit to chge/ASN1.js that referenced this issue Sep 6, 2018
This quick'n'dirty fix allows dependents to use Bublé transpiler: bublejs/buble#150
chge added a commit to chge/ASN1.js that referenced this issue Sep 6, 2018
This quick'n'dirty fix allows dependents to use Bublé transpiler: bublejs/buble#150
@adrianheine adrianheine added the bug label Oct 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants