private void processProvideCall(NodeTraversal t, Node n, Node parent) {
    checkState(n.isCall());
    Node left = n.getFirstChild();
    Node arg = left.getNext();
    if (verifyProvide(left, arg)) {
      String ns = arg.getString();

      maybeAddNameToSymbolTable(left);
      maybeAddStringToSymbolTable(arg);

      if (providedNames.containsKey(ns)) {
        ProvidedName previouslyProvided = providedNames.get(ns);
        if (!previouslyProvided.isExplicitlyProvided() || previouslyProvided.isPreviouslyProvided) {
          previouslyProvided.addProvide(parent, t.getModule(), true);
        } else {
          String explicitSourceName = previouslyProvided.explicitNode.getSourceFileName();
          compiler.report(
              JSError.make(
                  n, ProcessClosurePrimitives.DUPLICATE_NAMESPACE_ERROR, ns, explicitSourceName));
        }
      } else {
        registerAnyProvidedPrefixes(ns, parent, t.getModule());
        providedNames.put(
            ns,
            new ProvidedName(
                ns, parent, t.getModule(), /* explicit= */ true, /* fromPreviousProvide= */ false));
      }
    }
  }
private void processProvideCall ( NodeTraversal t , Node n , Node parent ) { checkState ( n . isCall ( ) ) ; Node left = n . getFirstChild ( ) ; Node arg = left . getNext ( ) ; if ( verifyProvide ( left , arg ) ) { String ns = arg . getString ( ) ; maybeAddNameToSymbolTable ( left ) ; maybeAddStringToSymbolTable ( arg ) ; if ( providedNames . containsKey ( ns ) ) { ProvidedName previouslyProvided = providedNames . get ( ns ) ; if ( ! previouslyProvided . isExplicitlyProvided ( ) || previouslyProvided . isPreviouslyProvided ) { previouslyProvided . addProvide ( parent , t . getModule ( ) , true ) ; } else { String explicitSourceName = previouslyProvided . explicitNode . getSourceFileName ( ) ; compiler . report ( JSError . make ( n , ProcessClosurePrimitives . DUPLICATE_NAMESPACE_ERROR , ns , explicitSourceName ) ) ; } } else { registerAnyProvidedPrefixes ( ns , parent , t . getModule ( ) ) ; providedNames . put ( ns , new ProvidedName ( ns , parent , t . getModule ( ) , true , false ) ) ; } } }
Handles a goog.provide call.