fix parser tests

This commit is contained in:
강동윤 2018-11-19 19:58:35 +09:00
parent c816d699ca
commit dc8e178088
2 changed files with 9 additions and 17 deletions

View File

@ -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(())
});
}

View File

@ -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(),