MCPcopy Create free account
hub / github.com/dop251/goja / parseArrowFunction

Method parseArrowFunction

parser/expression.go:1192–1202  ·  view source on GitHub ↗
(start file.Idx, paramList *ast.ParameterList, async bool)

Source from the content-addressed store, hash-verified

1190}
1191
1192func (self *_parser) parseArrowFunction(start file.Idx, paramList *ast.ParameterList, async bool) ast.Expression {
1193 self.expect(token.ARROW)
1194 node := &ast.ArrowFunctionLiteral{
1195 Start: start,
1196 ParameterList: paramList,
1197 Async: async,
1198 }
1199 node.Body, node.DeclarationList = self.parseArrowFunctionBody(async)
1200 node.Source = self.slice(start, node.Body.Idx1())
1201 return node
1202}
1203
1204func (self *_parser) parseSingleArgArrowFunction(start file.Idx, async bool) ast.Expression {
1205 if async != self.scope.allowAwait {

Callers 2

Calls 4

expectMethod · 0.95
sliceMethod · 0.95
Idx1Method · 0.65

Tested by

no test coverage detected