Convert to list to avoid 'Adding to unmodifiable list' exception.
Convert to list to avoid 'Adding to unmodifiable list' exception.

Change-Id: I1c5a6dad96435d8059d5d05362ab938cb91435b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166303
Reviewed-by: Konstantin Shcheglov <09e4d7516628963212bf4aace2f97603d2b706e4@google.com>
Commit-Queue: Keerti Parthasarathy <50d1d8bfaf73a210aebf5aef847d5b7b93955336@google.com>

dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk