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

Method parseVariableDeclaration

parser/expression.go:306–321  ·  view source on GitHub ↗
(declarationList *[]*ast.Binding)

Source from the content-addressed store, hash-verified

304}
305
306func (self *_parser) parseVariableDeclaration(declarationList *[]*ast.Binding) *ast.Binding {
307 node := &ast.Binding{
308 Target: self.parseBindingTarget(),
309 }
310
311 if declarationList != nil {
312 *declarationList = append(*declarationList, node)
313 }
314
315 if self.token == token.ASSIGN {
316 self.next()
317 node.Initializer = self.parseAssignmentExpression()
318 }
319
320 return node
321}
322
323func (self *_parser) parseVariableDeclarationList() (declarationList []*ast.Binding) {
324 for {

Callers 2

Calls 3

parseBindingTargetMethod · 0.95
nextMethod · 0.95

Tested by

no test coverage detected