bar ? void 0 : foo ? void 0 : <etc> bar || foo : void 0 TODO: turn this into general equiv check
351919
function(path) {
            const { node } = path;

            if (node[condExprSeen] || !isVoid0(node.consequent)) {
              return;
            }

            node[condExprSeen] = true;

            const tests = [node.test];
            const mutations = [];
            let alt;
            for (
              let next = path.get("alternate");
              next.isConditionalExpression();
              next = next.get("alternate")
            ) {
              next.node[condExprSeen] = true;
              alt = next.node.alternate;

              if (isVoid0(next.node.consequent)) {
                tests.push(next.node.test);
                mutations.push(() => next.remove());
              } else {
                alt = next.node;
                break;
              }
            }

            if (tests.length === 1) {
              return;
            }

            const test = tests.reduce((expr, curTest) =>
              t.logicalExpression("||", expr, curTest)
            );

            path.replaceWith(t.conditionalExpression(test, VOID_0, alt));
          }
501552
private void checkOperand(Type type, Expr operand, Environment environment) {
		checkIsSubtype(type, checkExpression(operand, environment), environment, operand);
	}
1178233
function checkPseudoClass2(i) {
  const start = i;
  let l;

  // Skip `:`.
  i++;

  if (i >= tokensLength) return 0;

  if (l = checkIdentOrInterpolation(i)) i += l;
  else return 0;

  if (i >= tokensLength ||
      tokens[i].type !== TokenType.LeftParenthesis) return 0;

  const right = tokens[i].right;

  // Skip `(`.
  i++;

  if (l = checkSC(i)) i += l;

  if (l = checkIdentOrInterpolation(i)) i += l;
  else return 0;

  if (l = checkSC(i)) i += l;

  if (i !== right) return 0;

  // Skip `)`.
  i++;

  return i - start;
}
913016
function checkValue(i) {
  const start = i;
  let l;
  let s;
  let _i;

  while (i < tokensLength) {
    if (checkDeclDelim(i)) break;

    s = checkSC(i);
    _i = i + s;

    if (l = _checkValue(_i)) i += l + s;
    if (!l || checkBlock(i - l)) break;
  }

  tokens[start].value_end = i;

  return i - start;
}
648878
function equalType (a, b) {
  if (Array.isArray(a) && Array.isArray(b)) {
    if (0 === a.length || 0 === b.length) {
      return true;
    }

    return equalType(a[0], b[0]);
  }

  if ('null' == a || 'null' == b) {
    return true;
  }

  return a == b;
}
14820
Expr ternary() {
		Expr cond = or();
		if (peek().sym == Sym.QUESTION) {
			move();
			Expr exprOne = expr();
			match(Sym.COLON);
			return new Ternary(cond, exprOne, expr(), location);
		}
		return cond;
	}
955229
function(a) {

            if (typeof(e) == 'number') {
                if(isNaN(e) !== isNaN(a))
                    expected(e, "to be equalish to", a);
                if(Math.abs(e - a) >= EPSILON)
                    expected(e, "to be equalish to", a);
            }

            if (e.length != a.length)
                assert.fail(e.length, a.length, "length mismatch");


            for (let i = 0; i < e.length; i++) {
                if (isNaN(e[i]) !== isNaN(a[i]))
                    assert.fail(isNaN(e[i]), isNaN(a[i]));
                if (Math.abs(e[i] - a[i]) >= EPSILON)
                    assert.fail(Math.abs(e[i] - a[i]));
            }
        }
1294844
Expr unary() {
		Tok tok = peek();
		switch (tok.sym) {
		case NOT:
			move();
			return new Logic(tok.sym, unary(), location);
		case ADD:
		case SUB:
			move();
			return new Unary(tok.sym, unary(), location).toConstIfPossible();
		case INC:
		case DEC:
			move();
			return new IncDec(tok.sym, false, incDec(), location);
		default:
			return incDec();
		}
	}
1300668
function(object, method) {
      if (object == null) return void 0;
      var func = object[method];
      var args = slice.call(arguments, 2);
      return _.isFunction(func) ? func.apply(object, args) : void 0;
    }
520135
function checkDeclaration1(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  if (l = checkProperty(i)) i += l;
  else return 0;

  if (l = checkSC(i)) i += l;

  if (l = checkPropertyDelim(i)) i++;
  else return 0;

  if (l = checkValue(i)) return i + l - start;

  if (l = checkS(i)) i += l;

  if (l = checkValue(i)) i += l;
  else return 0;

  return i - start;
}
12
def check_symbol_to_proc
      return unless method_call.block_argument_names.count == 1
      return if method_call.block_body.nil?
      return unless method_call.block_body.sexp_type == :call
      return if method_call.arguments.count > 0

      body_method_call = MethodCall.new(method_call.block_body)

      return unless body_method_call.arguments.count.zero?
      return if body_method_call.has_block?
      return unless body_method_call.receiver.name == method_call.block_argument_names.first

      add_offense(:block_vs_symbol_to_proc)
    end
293639
function(loc, left, right) {
			var a, b;
			if (loc instanceof Range) {
				a = loc.start;
				b = loc.end;
			} else {
				a = b = loc;
			}
			
			return cmp(this.start, a, left || '<=') && cmp(this.end, b, right || '>');
		}
150558
function checkValue(i) {
  const start = i;
  let l;
  let s;
  let _i;

  while (i < tokensLength) {
    if (checkDeclDelim(i)) break;

    if (l = checkBlock(i)) {
      i += l;
      break;
    }

    s = checkS(i);
    _i = i + s;

    if (l = _checkValue(_i)) i += l + s;
    if (!l || checkBlock(i - l)) break;
  }

  return i - start;
}
1077419
function checkBrackets(i) {
  if (i >= tokensLength) return 0;

  const start = i;

  // Skip `[`.
  if (tokens[i].type === TokenType.LeftSquareBracket) i++;
  else return 0;

  if (i < tokens[start].right) {
    const l = checkTsets(i);
    if (l) i += l;
    else return 0;
  }

  // Skip `]`.
  i++;

  return i - start;
}
157801
Expr or() {
		Expr expr = and();
		for (Tok tok=peek(); tok.sym==Sym.OR; tok=peek()) {
			move();
			expr = new Logic(Sym.OR, expr, and(), location);
		}
		return expr;
	}
905668
def equals?(other)
      if other.is_a?(CF::Base)
        @ptr.address == other.to_ptr.address
      else
        false
      end
    end
565862
def has_void_args(argv):
    
    n_args = len(argv)
    return n_args == 1 or n_args == 2 and argv[1].startswith('--conf=') or n_args == 3 and argv[1] == '--conf'