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

Method parseFunctionBlock

parser/statement.go:266–276  ·  view source on GitHub ↗
(async, allowAwait, allowYield bool)

Source from the content-addressed store, hash-verified

264}
265
266func (self *_parser) parseFunctionBlock(async, allowAwait, allowYield bool) (body *ast.BlockStatement, declarationList []*ast.VariableDeclaration) {
267 self.openScope()
268 self.scope.inFunction = true
269 self.scope.inAsync = async
270 self.scope.allowAwait = allowAwait
271 self.scope.allowYield = allowYield
272 defer self.closeScope()
273 body = self.parseBlockStatement()
274 declarationList = self.scope.declarationList
275 return
276}
277
278func (self *_parser) parseArrowFunctionBody(async bool) (ast.ConciseBody, []*ast.VariableDeclaration) {
279 if self.token == token.LEFT_BRACE {

Callers 4

parseMethodDefinitionMethod · 0.95
parseFunctionMethod · 0.95
parseClassMethod · 0.95

Calls 3

openScopeMethod · 0.95
closeScopeMethod · 0.95
parseBlockStatementMethod · 0.95

Tested by

no test coverage detected