MCPcopy Index your code
hub / github.com/jquery/esprima / matchAsyncFunction

Method matchAsyncFunction

src/parser.ts:2843–2855  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2841 }
2842
2843 matchAsyncFunction(): boolean {
2844 let match = this.matchContextualKeyword('async');
2845 if (match) {
2846 const state = this.scanner.saveState();
2847 this.scanner.scanComments();
2848 const next = this.scanner.lex();
2849 this.scanner.restoreState(state);
2850
2851 match = (state.lineNumber === next.lineNumber) && (next.type === Token.Keyword) && (next.value === 'function');
2852 }
2853
2854 return match;
2855 }
2856
2857 parseFunctionDeclaration(identifierIsOptional?: boolean): Node.AsyncFunctionDeclaration | Node.FunctionDeclaration {
2858 const node = this.createNode();

Callers 3

parseStatementMethod · 0.95

Calls 5

saveStateMethod · 0.80
scanCommentsMethod · 0.80
lexMethod · 0.80
restoreStateMethod · 0.80

Tested by

no test coverage detected