cloneList<E> method

  1. @override
List<E> cloneList<E>(
  1. List<E> source
)
override

Return a deep-cloned List.

When doTypedClone is true the returned list performs typed cloning of elements. Typed cloning will throw UnsupportedTypedCloneException if a nested Map is encountered.

Preserves UnmodifiableListView by wrapping the cloned list.

Implementation

@override
List<E> cloneList<E>(List<E> source) {
  if (_nestIndex++ > nestLimit) {
    throw LimitExceededException('Nest', _nestIndex);
  }
  final cloned = super.cloneList<E>(source);
  _nestIndex--;
  return cloned;
}