From dc8e178088ae0d0dfacbc35419b7a61c4d0c1d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Mon, 19 Nov 2018 19:58:35 +0900 Subject: [PATCH] fix parser tests --- ecmascript/parser/benches/bench.rs | 10 +--------- ecmascript/parser/src/parser/expr/tests.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/ecmascript/parser/benches/bench.rs b/ecmascript/parser/benches/bench.rs index 41cc7add57b..ddfe0a03632 100644 --- a/ecmascript/parser/benches/bench.rs +++ b/ecmascript/parser/benches/bench.rs @@ -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(()) }); } diff --git a/ecmascript/parser/src/parser/expr/tests.rs b/ecmascript/parser/src/parser/expr/tests.rs index 2c872190431..7fecaf9849b 100644 --- a/ecmascript/parser/src/parser/expr/tests.rs +++ b/ecmascript/parser/src/parser/expr/tests.rs @@ -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(),