code: private Node tryFlattenArrayOrObjectLit(Node parentLit) {
      for (Node child = parentLit.getFirstChild(); child != null; ) {
        // We have to store the next element here because nodes may be inserted below.
        Node spread = child;
        child = child.getNext();
  
        if (!spread.isSpread()) {
          continue;
        }
  
        Node innerLit = spread.getOnlyChild();
        if (!parentLit.getToken().equals(innerLit.getToken())) {
          continue; // We only want to inline arrays into arrays and objects into objects.
        }
  
        parentLit.addChildrenAfter(innerLit.removeChildren(), spread);
        spread.detach();
        reportChangeToEnclosingScope(parentLit);
      }
      return parentLit;
    }
docs: Flattens array- or object-literals that contain spreads of other literals.
  
  <p>Does not recurse into nested spreads because this method is already called as part of a
  postorder traversal and nested spreads will already have been flattened.
  
  <p>Example: `[0, ...[1, 2, 3], 4, ...[5]]` => `[0, 1, 2, 3, 4, 5]`