# Tenko parser test case

- Path: tests/testcases/async_keyword/class_method/async_object_method_with_newline_after_params.md

> :: async keyword : class method
>
> ::> async object method with newline after params

## Input

`````js
class x {async foo () 
 {}}
`````

## Output

_Note: the whole output block is auto-generated.  Manual changes will be overwritten!_ 

Below follow outputs in five parsing modes: sloppy, sloppy+annexb, strict script, module, module+annexb. 

Note that the output parts are auto-generated by the test runner to reflect actual result. 

### Sloppy mode

Parsed with script goal and as if the code did not start with strict mode header. 

`````
ast: {
  type: 'Program',
  loc:{start:{line:1,column:0},end:{line:2,column:4},source:''},
  body: [
    {
      type: 'ClassDeclaration',
      loc:{start:{line:1,column:0},end:{line:2,column:4},source:''},
      id: {
        type: 'Identifier',
        loc:{start:{line:1,column:6},end:{line:1,column:7},source:''},
        name: 'x'
      },
      superClass: null,
      body: {
        type: 'ClassBody',
        loc:{start:{line:1,column:8},end:{line:2,column:4},source:''},
        body: [
          {
            type: 'MethodDefinition',
            loc:{start:{line:1,column:9},end:{line:2,column:3},source:''},
            key: {
              type: 'Identifier',
              loc:{start:{line:1,column:15},end:{line:1,column:18},source:''},
              name: 'foo'
            },
            static: false,
            computed: false,
            kind: 'method',
            value: {
              type: 'FunctionExpression',
              loc:{start:{line:1,column:9},end:{line:2,column:3},source:''},
              generator: false,
              async: true,
              id: null,
              params: [],
              body: {
                type: 'BlockStatement',
                loc:{start:{line:2,column:1},end:{line:2,column:3},source:''},
                body: []
              }
            }
          }
        ]
      }
    }
  ]
}

tokens (11x):
       ID_class IDENT PUNC_CURLY_OPEN ID_async IDENT PUNC_PAREN_OPEN
       PUNC_PAREN_CLOSE PUNC_CURLY_OPEN PUNC_CURLY_CLOSE
       PUNC_CURLY_CLOSE
`````

### Strict mode

Parsed with script goal but as if it was starting with `"use strict"` at the top. 

_Output same as sloppy mode._ 

### Module goal

Parsed with the module goal. 

_Output same as sloppy mode._ 

### Sloppy mode with AnnexB

Parsed with script goal with AnnexB rules enabled and as if the code did not start with strict mode header. 

_Output same as sloppy mode._ 

### Module goal with AnnexB

Parsed with the module goal with AnnexB rules enabled. 

_Output same as sloppy mode._ 

## AST Printer

Printer output different from input [sloppy][annexb:no]:

````js
class x{async foo(){};}
````

Produces same AST
