[Bug]: Parsing doesn't finish for unmatched bracket in TypeScript type expression #14298
Closed
1 task
Labels
i: needs triage
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
馃捇
How are you using Babel?
@babel/cli
Input code
Configuration file name
babel.config.json
Configuration
Current and expected behavior
Current behavior - parsing does not finish
Expected behavior - a syntax error should be thrown
Environment
System:
OS: Linux 4.4 Ubuntu 20.04.2 LTS (Focal Fossa)
Binaries:
Node: 16.13.1 - ~/local/lib/node-v16.13.1-linux-x64/bin/node
npm: 8.1.2 - ~/local/lib/node-v16.13.1-linux-x64/bin/npm
npmPackages:
@babel/cli: ^7.17.6 => 7.17.6
@babel/core: ^7.17.5 => 7.17.5
@babel/preset-typescript: ^7.16.7 => 7.16.7
Possible solution
The problem seems to occur at
tsSkipParameterStart()
inpackages/babel-parser/src/plugins/typescript/index.js
In the above
while
loop, a syntax error should be thrown whentt.eof
is matched.(or maybe just returning false would work?)
Additional context
No response
The text was updated successfully, but these errors were encountered: