Index: pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart |
diff --git a/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart b/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart |
index e62ede56ac3c587c29db9965d08421340c353473..f837e4f50ad2ac1e08556f5e211f9eccf8096b7d 100644 |
--- a/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart |
+++ b/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart |
@@ -156,6 +156,9 @@ class ValidatingInstrumentation implements Instrumentation { |
void record( |
Uri uri, int offset, String property, InstrumentationValue value) { |
uri = Uri.base.resolveUri(uri); |
+ if (offset == -1) { |
+ throw _formatProblem(uri, 0, 'No offset for $property=$value', null); |
+ } |
var expectationsForUri = _unsatisfiedExpectations[uri]; |
if (expectationsForUri == null) return; |
var expectationsAtOffset = expectationsForUri[offset]; |