bublejs / bublejs/buble

`super` in concise methods not working

Open
#124 3 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
874
Forks
62
PR merge metrics
No merged PRs in 30d

Description

Using `super` in method shorthands ("concise methods") is valid syntax, but Buble doesn't think so. See [the example](https://buble.surge.sh/#%20%20%20%20const%20B%20%3D%20A.subclass(%7B%0A%20%20%20%20%20%20%20%20foo(n)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(n%20%3E%20100)%20return%20-1%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20super.foo(n%2B1)%3B%20%2F%2F%20RIGHT%20HERE%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D)).

For reference, here's [Babel's example](http://babeljs.io/repl/#?babili=false&browsers=ie%208&build=&builtIns=false&code_lz=AQ4YwewOwZwF2AIWAXmAQQHQwK4CMwAbAQxhgAoBvAKFDuADMIJyoBKYG-74ASweCtgAPmABGAAwSOAJwCmcHDKjAAtGIDctHnXmLlwXAAc5MzExZQA1GLYbgAegfAASgEkA4gAkAKsC8Aoi4B2twAvqHAYWxAA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=true&fileSize=false&lineWrap=true&presets=es2015%2Ces2016%2Ces2017%2Creact%2Cstage-2%2Ces2015-loose%2Cenv&prettier=false&targets=&version=6.26.0&envVersion=1.6.2).

In earlier versions of Buble, the [error is not helpful at all](https://github.com/rollup/rollup/issues/1623#issuecomment-378833862), resulting in

```
Cannot read property 'magicString' of undefined
```

I had to hunt the line down by deleting code until I was left with the culprit.

Note, I'm running only Buble (no Rollup).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.