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

Method parseLexicalDeclaration

parser/statement.go:796–811  ·  view source on GitHub ↗
(tok token.Token)

Source from the content-addressed store, hash-verified

794}
795
796func (self *_parser) parseLexicalDeclaration(tok token.Token) *ast.LexicalDeclaration {
797 idx := self.expect(tok)
798 if !self.scope.allowLet {
799 self.error(idx, "Lexical declaration cannot appear in a single-statement context")
800 }
801
802 list := self.parseVariableDeclarationList()
803 self.ensurePatternInit(list)
804 self.semicolon()
805
806 return &ast.LexicalDeclaration{
807 Idx: idx,
808 Token: tok,
809 List: list,
810 }
811}
812
813func (self *_parser) parseDoWhileStatement() ast.Statement {
814 inIteration := self.scope.inIteration

Callers 1

parseStatementMethod · 0.95

Calls 5

expectMethod · 0.95
errorMethod · 0.95
ensurePatternInitMethod · 0.95
semicolonMethod · 0.95

Tested by

no test coverage detected