mirror of
https://github.com/swc-project/swc.git
synced 2024-12-01 09:52:57 +03:00
fix(es/parser): Report errors for multiple array elements without comma (#2366)
This commit is contained in:
parent
e2a0edd49d
commit
521e6717ad
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -2683,7 +2683,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "swc_ecma_parser"
|
||||
version = "0.73.1"
|
||||
version = "0.73.2"
|
||||
dependencies = [
|
||||
"either",
|
||||
"enum_kind",
|
||||
|
@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"]
|
||||
license = "Apache-2.0/MIT"
|
||||
name = "swc_ecma_parser"
|
||||
repository = "https://github.com/swc-project/swc.git"
|
||||
version = "0.73.1"
|
||||
version = "0.73.2"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
@ -451,7 +451,7 @@ impl<'a, I: Tokens> Parser<I> {
|
||||
.parse_expr_or_spread()
|
||||
.map(Some)?,
|
||||
);
|
||||
if is!(self, ',') {
|
||||
if !is!(self, ']') {
|
||||
expect!(self, ',');
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1 @@
|
||||
const arr = [a b]
|
@ -0,0 +1,6 @@
|
||||
error: Expected ',', got 'b'
|
||||
--> $DIR/tests/typescript-errors/array-expression/input.ts:1:16
|
||||
|
|
||||
1 | const arr = [a b]
|
||||
| ^
|
||||
|
Loading…
Reference in New Issue
Block a user