code: private void maybeAddPropertiesToWorklist(Name name, Deque<Name> workList) {
      if (!(name.isObjectLiteral() || name.isFunction() || name.isClass())) {
        // Don't add properties for things like `Foo` in
        //   const Foo = someMysteriousFunctionCall();
        // Since `Foo` is not declared as an object, class, or function literal, assume its value
        // may be aliased somewhere and its properties do not meet condition (a).
        return;
      }
      if (isUnsafelyReassigned(name)) {
        // Don't add properties if this was assigned multiple times, except for 'safe' reassignments:
        //    var ns = ns || {};
        // This is equivalent to condition (b)
        return;
      }
      if (name.props == null) {
        return;
      }
  
      if (name.getAliasingGets() == 0) {
        // All of {@code name}'s children meet condition (a), so they can be
        // added to the worklist.
        workList.addAll(name.props);
      } else {
        // The children do NOT meet condition (a) but we may try to add them anyway.
        // This is because CollapseProperties will unsafely collapse properties on constructors and
        // enums, so we want to be more aggressive about inlining references to their children.
        for (Name property : name.props) {
          // Only add properties that would be unsafely collapsed by CollapseProperties
          if (property.canCollapse()) {
            workList.add(property);
          }
        }
      }
    }
docs: Adds properties of `name` to the worklist if the following conditions hold:
  
  <ol>
  <li>1. The given property of `name` either meets condition (a) or is unsafely collapsible (as
  defined by {@link Name#canCollapse()}
  <li>2. `name` meets condition (b)
  </ol>
  
  This only adds direct properties of a name, not all its descendants. For example, this adds
  `a.b` given `a`, but not `a.b.c`.