lebab / lebab

Turn your ES5 code into readable ES6. Lebab does the opposite of what Babel does.
https://lebab.github.io
MIT License
5.63k stars 150 forks source link

SyntaxError: Identifier 'word' has already been declared #235

Open kofifus opened 7 years ago

kofifus commented 7 years ago
>lebab fes6.js -o fes6.js --transform template
C:\Users\AppData\Roaming\npm\node_modules\lebab\node_modules\espree\espree.js:441
        throw err;
        ^

SyntaxError: Identifier 'word' has already been declared
    at Parser.instance.raise.instance.raiseRecoverable (C:\Users\AppData\Roaming\npm\node_modules\lebab\node_modules\espree\espree.js:437:19)
    at Parser.pp$2.checkLVal (C:\Users\AppData\Roaming\npm\node_modules\lebab\node_modules\acorn\dist\acorn.js:1651:14)
    at Parser.checkLVal (C:\Users\AppData\Roaming\npm\node_modules\lebab\node_modules\espree\espree.js:285:30)
    at Parser.pp$1.parseVarId (C:\Users\AppData\Roaming\npm\node_modules\lebab\node_modules\acorn\dist\acorn.js:1132:8)
    at Parser.pp$1.parseVar (C:\Users\AppData\Roaming\npm\node_modules\lebab\node_modules\acorn\dist\acorn.js:1114:12)
    at Parser.pp$1.parseVarStatement (C:\Users\AppData\Roaming\npm\node_modules\lebab\node_modules\acorn\dist\acorn.js:992:8)
    at Parser.pp$1.parseStatement (C:\Users\AppData\Roaming\npm\node_modules\lebab\node_modules\acorn\dist\acorn.js:764:17)
    at Parser.pp$1.parseBlock (C:\Users\AppData\Roaming\npm\node_modules\lebab\node_modules\acorn\dist\acorn.js:1064:23)
    at Parser.pp$3.parseFunctionBody (C:\Users\AppData\Roaming\npm\node_modules\lebab\node_modules\acorn\dist\acorn.js:2426:22)
    at Parser.pp$1.parseFunction (C:\Users\AppData\Roaming\npm\node_modules\lebab\node_modules\acorn\dist\acorn.js:1165:8)

This seems to happen for the next transform running after 'let'

nene commented 7 years ago

Thanks for the report. Please include a code snippet which you're trying to transform, that causes the crash.

nene commented 7 years ago

Having received no further information for several months, I'm closing this.

IlyaGulya commented 4 years ago

Hello @nene! Here's simple snippet which causes espree to fail during parsing:

function testFn(e, t) {
}

var testFn
nene commented 4 years ago

Thanks.

nene commented 1 year ago

Unfortunatly not much I can do about this as this is a problem in espree parser.