Bug Report
Current Behavior
If a bianry operator like >= appears directly after TypeScript as assertion, a wrong SyntaxError occurs.
Input Code
function foo(x: any) {
return x as number >= 0;
}
The above code causes the following SyntaxError:
{ SyntaxError: test.ts: Unexpected token (2:22)
1 | function foo(x: any) {
> 2 | return x as number >= 0;
| ^
3 | }
4 |
Expected behavior/code
No SyntaxError should occur.
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
{
"presets": ["@babel/preset-typescript"]
}
Environment
System:
OS: Linux 4.4 Ubuntu 14.04.5 LTS, Trusty Tahr
Binaries:
Node: 10.15.1 - ~/local/lib/node-v10.15.1-linux-x64/bin/node
Yarn: 1.22.4 - ~/local/lib/node-v10.15.1-linux-x64/bin/yarn
npm: 6.9.0 - ~/local/lib/node-v10.15.1-linux-x64/bin/npm
npmPackages:
@babel/cli: ^7.8.4 => 7.8.4
@babel/core: ^7.9.0 => 7.9.0
@babel/preset-typescript: ^7.9.0 => 7.9.0
Bug Report
Current Behavior
If a bianry operator like
>=appears directly after TypeScriptasassertion, a wrong SyntaxError occurs.Input Code
The above code causes the following SyntaxError:
Expected behavior/code
No SyntaxError should occur.
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
.babelrcEnvironment