| Index: pkg/intl/lib/src/intl_message.dart
|
| diff --git a/pkg/intl/lib/src/intl_message.dart b/pkg/intl/lib/src/intl_message.dart
|
| index 97eb48ed2a3a1c88ee3a0fc031f234b5a4448055..8bb9fdb4805eb8531631e244d963d5eb8542d525 100644
|
| --- a/pkg/intl/lib/src/intl_message.dart
|
| +++ b/pkg/intl/lib/src/intl_message.dart
|
| @@ -69,6 +69,11 @@ abstract class Message {
|
| */
|
| get examples => parent == null ? const [] : parent.examples;
|
|
|
| + /**
|
| + * The name of the top-level [MainMessage].
|
| + */
|
| + String get name => parent == null ? '<unnamed>' : parent.name;
|
| +
|
| String checkValidity(MethodInvocation node, List arguments,
|
| String outerName, FormalParameterList outerArgs) {
|
| var hasArgs = arguments.any(
|
| @@ -274,6 +279,12 @@ class VariableSubstitution extends Message {
|
| // case-insensitive.
|
| _index = arguments.map((x) => x.toUpperCase()).toList()
|
| .indexOf(_variableNameUpper);
|
| + if (_index == -1) {
|
| + throw new ArgumentError(
|
| + "Cannot find parameter named '$_variableNameUpper' in "
|
| + "message named '$name'. Available "
|
| + "parameters are $arguments");
|
| + }
|
| return _index;
|
| }
|
|
|
|
|