code: private static FoldArrayAction isSafeToFoldArrayConstructor(Node arg) {
      FoldArrayAction action = FoldArrayAction.NOT_SAFE_TO_FOLD;
  
      if (arg == null) {
        action = FoldArrayAction.SAFE_TO_FOLD_WITHOUT_ARGS;
      } else if (arg.getNext() != null) {
        action = FoldArrayAction.SAFE_TO_FOLD_WITH_ARGS;
      } else {
        switch (arg.getToken()) {
          case STRING:
            // "Array('a')" --> "['a']"
            action = FoldArrayAction.SAFE_TO_FOLD_WITH_ARGS;
            break;
          case NUMBER:
            // "Array(0)" --> "[]"
            if (arg.getDouble() == 0) {
              action = FoldArrayAction.SAFE_TO_FOLD_WITHOUT_ARGS;
            }
            break;
          case ARRAYLIT:
            // "Array([args])" --> "[[args]]"
            action = FoldArrayAction.SAFE_TO_FOLD_WITH_ARGS;
            break;
          default:
        }
      }
      return action;
    }
docs: Checks if it is safe to fold Array() constructor into []. It can be
  obviously done, if the initial constructor has either no arguments or
  at least two. The remaining case may be unsafe since Array(number)
  actually reserves memory for an empty array which contains number elements.