Fix build_pkgs.dart to not mutate arguments list. (#30078)

* Fix build_pkgs.dart to not mutate arguments list.

Also remove build of when package since it's apparently gone now.

* Use sublist to remove element.
This commit is contained in:
Bob Nystrom 2017-07-05 12:20:58 -07:00 committed by GitHub
parent d2569cc3ee
commit 52a9e3d9c6

View file

@ -17,7 +17,9 @@ String outputDirectory;
/// Otherwise, only builds the modules needed by the tests.
void main(List<String> arguments) {
var isTravis = arguments.isNotEmpty && arguments.last == "travis";
if (isTravis) arguments.removeLast();
if (isTravis) {
arguments = arguments.sublist(0, arguments.length - 1);
}
if (arguments.length != 1) {
print("Usage: dart build_pkgs.dart <output_dir> [travis]");
@ -55,7 +57,6 @@ void main(List<String> arguments) {
compileModule('typed_data');
compileModule('usage');
compileModule('utf');
compileModule('when');
}
// Composite packages with dependencies.