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

Method parseConditionalExpression

parser/expression.go:1172–1190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1170}
1171
1172func (self *_parser) parseConditionalExpression() ast.Expression {
1173 left := self.parseLogicalOrExpression()
1174
1175 if self.token == token.QUESTION_MARK {
1176 self.next()
1177 allowIn := self.scope.allowIn
1178 self.scope.allowIn = true
1179 consequent := self.parseAssignmentExpression()
1180 self.scope.allowIn = allowIn
1181 self.expect(token.COLON)
1182 return &ast.ConditionalExpression{
1183 Test: left,
1184 Consequent: consequent,
1185 Alternate: self.parseAssignmentExpression(),
1186 }
1187 }
1188
1189 return left
1190}
1191
1192func (self *_parser) parseArrowFunction(start file.Idx, paramList *ast.ParameterList, async bool) ast.Expression {
1193 self.expect(token.ARROW)

Callers 1

Calls 4

nextMethod · 0.95
expectMethod · 0.95

Tested by

no test coverage detected