mirror of
https://github.com/swc-project/swc.git
synced 2024-12-23 21:54:36 +03:00
fix parser tests
This commit is contained in:
parent
c816d699ca
commit
dc8e178088
@ -96,15 +96,7 @@ fn bench_parse_module(b: &mut Bencher) {
|
||||
SourceFileInput::from(&*fm),
|
||||
);
|
||||
|
||||
b.iter(|| {
|
||||
parser
|
||||
.parse_module()
|
||||
.map_err(|err| {
|
||||
err.emit();
|
||||
()
|
||||
})
|
||||
.unwrap()
|
||||
});
|
||||
b.iter(|| parser.parse_module().unwrap());
|
||||
Ok(())
|
||||
});
|
||||
}
|
||||
|
@ -127,8 +127,8 @@ fn arrow_fn_no_args() {
|
||||
expr("() => 1"),
|
||||
box Expr::Arrow(ArrowExpr {
|
||||
span,
|
||||
is_async: false,
|
||||
is_generator: false,
|
||||
async_token: None,
|
||||
generator_token: None,
|
||||
params: vec![],
|
||||
body: BlockStmtOrExpr::Expr(expr("1")),
|
||||
})
|
||||
@ -140,8 +140,8 @@ fn arrow_fn() {
|
||||
expr("(a) => 1"),
|
||||
box Expr::Arrow(ArrowExpr {
|
||||
span,
|
||||
is_async: false,
|
||||
is_generator: false,
|
||||
async_token: None,
|
||||
generator_token: None,
|
||||
params: vec![Pat::Ident(Ident {
|
||||
span,
|
||||
sym: "a".into(),
|
||||
@ -156,8 +156,8 @@ fn arrow_fn_rest() {
|
||||
expr("(...a) => 1"),
|
||||
box Expr::Arrow(ArrowExpr {
|
||||
span,
|
||||
is_async: false,
|
||||
is_generator: false,
|
||||
async_token: None,
|
||||
generator_token: None,
|
||||
params: vec![Pat::Rest(RestPat {
|
||||
dot3_token: span,
|
||||
arg: box Pat::Ident(Ident {
|
||||
@ -175,8 +175,8 @@ fn arrow_fn_no_paren() {
|
||||
expr("a => 1"),
|
||||
box Expr::Arrow(ArrowExpr {
|
||||
span,
|
||||
is_async: false,
|
||||
is_generator: false,
|
||||
async_token: None,
|
||||
generator_token: None,
|
||||
params: vec![Pat::Ident(Ident {
|
||||
span,
|
||||
sym: "a".into(),
|
||||
|
Loading…
Reference in New Issue
Block a user