refactor(dart/transform): Error in name convert funcs on unexpected input

Issue raised in PR #6745.
Previously, the transformer name conversion functions could return the
input string on unexpected input, which is almost certainly an error.

`throw` in this case instead, so we know early that something has likely
gone wrong.

Closes #6753
This commit is contained in:
Tim Blasi 2016-01-28 12:14:36 -08:00 committed by Timothy Blasi
parent f56df65d48
commit cfef76f683
1 changed files with 5 additions and 1 deletions

View File

@ -84,5 +84,9 @@ String _toExtension(
'$toExtension';
}
}
return uri;
throw new ArgumentError.value(
uri,
'uri',
'Provided value ends with an unexpected extension. '
'Expected extension(s): [${fromExtensions.join(', ')}].');
}