Exemple #1
0
func (this *JSConverter) VisitIsNotMissing(expr *expression.IsNotMissing) (interface{}, error) {
	var buf bytes.Buffer
	buf.WriteString("typeof(")
	buf.WriteString(this.Visit(expr.Operand()))
	buf.WriteString(") != 'undefined')")
	return buf.String(), nil
}
Exemple #2
0
func newSargNotMissing(expr *expression.IsNotMissing) *sargNotMissing {
	rv := &sargNotMissing{}
	rv.sarg = func(expr2 expression.Expression) (Spans, error) {
		if expr.EquivalentTo(expr2) {
			return _SELF_SPANS, nil
		}

		if !expr.Operand().EquivalentTo(expr2) {
			return nil, nil
		}

		return _FULL_SPANS, nil
	}

	return rv
}