| Index: tools/testing/dart/status_expression.dart
|
| diff --git a/tools/testing/dart/status_expression.dart b/tools/testing/dart/status_expression.dart
|
| index 957924927416e8c2e5beee6be39af7a3989ea687..96396ea57da967948a96b403dda1ef36a42a64b2 100644
|
| --- a/tools/testing/dart/status_expression.dart
|
| +++ b/tools/testing/dart/status_expression.dart
|
| @@ -30,6 +30,13 @@ library status_expression;
|
| * to A if B is true, and to the empty set if B is false.
|
| */
|
|
|
| +class ExprEvaluationException {
|
| + String error;
|
| +
|
| + ExprEvaluationException(this.error);
|
| +
|
| + toString() => error;
|
| +}
|
|
|
| class Token {
|
| static const String LEFT_PAREN = "(";
|
| @@ -97,7 +104,15 @@ class TermVariable {
|
|
|
| TermVariable(this.name);
|
|
|
| - String termValue(environment) => environment[name].toString();
|
| + String termValue(environment) {
|
| + var value = environment[name];
|
| + if (value == null) {
|
| + throw new ExprEvaluationException(
|
| + "Could not find '$name' in environment "
|
| + "while evaluating status file expression.");
|
| + }
|
| + return value.toString();
|
| + }
|
| }
|
|
|
|
|
|
|