Verifies AwaitExpressions satisfy spacing requirements
@param {ASTNode} node AwaitExpression AST node
@returns {void}
180789
function checkForSpacesAfterAwait(node) {
            const tokens = sourceCode.getFirstTokens(node, 3);

            checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], "await");
        }
46380
function asyncNeeded(funcDecl) {
  // the function body starts after the arguments
  var bodyPos;
  if(sl.typeOf(funcDecl[1]) === 'symbol') {
    bodyPos = 3;  // named function
  }
  else {
    bodyPos = 2;  // anonymous function
  }
  for(var i=bodyPos;i<funcDecl.length;i++) {
    if(sl.isList(funcDecl[i]) && sl.typeOf(funcDecl[i][0]) === 'symbol') {
      if(sl.valueOf(funcDecl[i][0]) === 'await') {
        return true;
      }
    }
  }
  return false;
}
58325
function internalIIAFE(body) {
        return {
            type: 'AwaitExpression',
            argument: asyncDefine({
                "type": "FunctionExpression",
                "generator": false,
                "expression": false,
                "async": true,
                "params": [],
                "body": {
                    "type": "BlockStatement",
                    "body": body
                }
            }).body.body[0].argument
        };
    }
433496
function processNode(node) {
            if (!node.code.trim()) {
                // empty
                return
            }

            const innerTokens = microTemplateService.getMicroTemplateTokensInfo(
                node
            ).innerTokens
            if (!innerTokens.length) {
                return
            }
            const statement = microTemplateService.getMicroTemplateExpressionStatement(
                node,
                sourceCode
            )
            if (!statement) {
                return
            }

            const innerLast = innerTokens[innerTokens.length - 1]
            if (innerLast.value === ";") {
                context.report({
                    node: innerLast,
                    messageId: "unexpected",
                    fix: fixer => fixer.remove(innerLast),
                })
            }
        }
844932
function(allowIn) {
      var node = this.startNode(_SequenceExpression);
      var expr = this.parseAssignmentExpression(allowIn);
      if (this.value !== ',') {
        return expr;
      }

      var exprs = [expr];

      do {
        this.next();
        exprs[exprs.length] = this.parseAssignmentExpression(allowIn);
      } while (this.value === ',');

      node.expressions = exprs;
      return this.finishNode(node);
    }
91859
function (node) {
            if (node.type !== "VariableDeclaration") {
                return false;
            }
            // 
            var firstDeclaration = node.declarations[0];
            if(firstDeclaration.init == null) {
                return false;
            }
            if (firstDeclaration.init.type === "CallExpression" &&
                firstDeclaration.init.callee.name === "require") {
                return true;
            }
            // .add
            if (firstDeclaration.init.type === "MemberExpression" &&
                firstDeclaration.init.object.type === "CallExpression" &&
                firstDeclaration.init.object.callee.name === "require") {
                return true;
            }
        }
951161
private boolean validTemplateTypeExpression(Node expr) {
    // The expression must have at least three children the type keyword,
    // a type name (or type variable) and a type expression
    if (!checkParameterCount(expr, Keywords.TYPE)) {
      return false;
    }
    int paramCount = getCallParamCount(expr);
    // The first parameter must be a type variable or a type name
    Node firstParam = getCallArgument(expr, 0);
    if (!isTypeVar(firstParam) && !isTypeName(firstParam)) {
      warnInvalid("type name or type variable", expr);
      warnInvalidInside("template type operation", expr);
      return false;
    }
    // The rest of the parameters must be valid type expressions
    for (int i = 1; i < paramCount; i++) {
      if (!validTypeTransformationExpression(getCallArgument(expr, i))) {
        warnInvalidInside("template type operation", expr);
        return false;
      }
    }
    return true;
  }
201624
function isAppendEmptyString(node) {
		return node.operator === "+=" && node.right.type === "Literal" && node.right.value === "";
	}
1343797
function (node) {
        var firstSpecifier = node.specifiers[0]
        var lastSpecifier = node.specifiers[node.specifiers.length - 1]

        // don't do anything for namespace or default imports
        if (firstSpecifier && lastSpecifier && firstSpecifier.type === 'ImportSpecifier' && lastSpecifier.type === 'ImportSpecifier') {
          var first = context.getTokenBefore(firstSpecifier)
          var second = context.getFirstToken(firstSpecifier)
          var penultimate = context.getLastToken(lastSpecifier)
          var last = context.getTokenAfter(lastSpecifier)

          validateBraceSpacing(node, first, second, penultimate, last)
        }
      }
1095677
private void convertAwaitOfAsyncGenerator(NodeTraversal t, LexicalContext ctx, Node awaitNode) {
    checkNotNull(awaitNode);
    checkState(awaitNode.isAwait());
    checkState(ctx != null && ctx.function != null);
    checkState(ctx.function.isAsyncGeneratorFunction());

    Node expression = awaitNode.removeFirstChild();
    checkNotNull(expression, "await needs an expression");
    Node newActionRecord =
        astFactory.createNewNode(
            astFactory.createQName(t.getScope(), ACTION_RECORD_NAME),
            astFactory.createQName(t.getScope(), ACTION_ENUM_AWAIT),
            expression);
    newActionRecord.useSourceInfoIfMissingFromForTree(awaitNode);
    awaitNode.addChildToFront(newActionRecord);
    awaitNode.setToken(Token.YIELD);
  }
966536
function parseExpression() {
        var expr = parseAssignmentExpression();

        if (match(',')) {
            expr = {
                type: Syntax.SequenceExpression,
                expressions: [ expr ]
            };

            while (index < length) {
                if (!match(',')) {
                    break;
                }
                lex();
                expr.expressions.push(parseAssignmentExpression());
            }

        }
        return expr;
    }
531401
function ObjectExpression(node, parent) {
  if (t.isExpressionStatement(parent)) {
    // ({ foo: "bar" });
    return true;
  }

  if (t.isMemberExpression(parent) && parent.object === node) {
    // ({ foo: "bar" }).foo
    return true;
  }

  return false;
}
1012714
function checkExpressionOrExportStatement(node) {
            const firstToken = isParenthesised(node) ? sourceCode.getTokenBefore(node) : sourceCode.getFirstToken(node);
            const secondToken = sourceCode.getTokenAfter(firstToken, astUtils.isNotOpeningParenToken);
            const thirdToken = secondToken ? sourceCode.getTokenAfter(secondToken) : null;
            const tokenAfterClosingParens = secondToken ? sourceCode.getTokenAfter(secondToken, astUtils.isNotClosingParenToken) : null;

            if (
                astUtils.isOpeningParenToken(firstToken) &&
                (
                    astUtils.isOpeningBraceToken(secondToken) ||
                    secondToken.type === "Keyword" && (
                        secondToken.value === "function" ||
                        secondToken.value === "class" ||
                        secondToken.value === "let" &&
                            tokenAfterClosingParens &&
                            (
                                astUtils.isOpeningBracketToken(tokenAfterClosingParens) ||
                                tokenAfterClosingParens.type === "Identifier"
                            )
                    ) ||
                    secondToken && secondToken.type === "Identifier" && secondToken.value === "async" && thirdToken && thirdToken.type === "Keyword" && thirdToken.value === "function"
                )
            ) {
                tokensToIgnore.add(secondToken);
            }

            if (hasExcessParens(node)) {
                report(node);
            }
        }
603789
function parseAssignmentExpression() {
        var token, expr, right, list, startToken;

        startToken = lookahead;
        token = lookahead;

        expr = parseConditionalExpression();

        if (expr.type === PlaceHolders.ArrowParameterPlaceHolder || match('=>')) {
            list = reinterpretAsCoverFormalsList(expr);

            if (list) {
                return parseArrowFunctionExpression(list, new WrappingNode(startToken));
            }
        }

        if (matchAssign()) {
            // LeftHandSideExpression
            if (!isLeftHandSide(expr)) {
                tolerateError(Messages.InvalidLHSInAssignment);
            }

            // 11.13.1
            if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
                tolerateUnexpectedToken(token, Messages.StrictLHSAssignment);
            }

            token = lex();
            right = parseAssignmentExpression();
            expr = new WrappingNode(startToken).finishAssignmentExpression(token.value, expr, right);
        }

        return expr;
    }
180559
function verifySpacing(node, lineOptions) {
            const actual = getPropertyWhitespace(node);

            if (actual) { // Object literal getters/setters lack colons
                report(node, "key", actual.beforeColon, lineOptions.beforeColon, lineOptions.mode);
                report(node, "value", actual.afterColon, lineOptions.afterColon, lineOptions.mode);
            }
        }
79674
function(path) {
            const { node } = path;

            if (node.operator !== "!") {
              return;
            }

            if (!t.isSequenceExpression(node.argument)) {
              return;
            }

            const seq = node.argument.expressions;
            const expr = seq[seq.length - 1];
            seq[seq.length - 1] = t.unaryExpression("!", expr, true);
            path.replaceWith(node.argument);
          }
90681
async function validate(descriptor) {
  const {valid, errors} = await Package.load(descriptor)
  return {valid, errors}
}