Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(785)

Side by Side Diff: pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart

Issue 2940453002: Add offsets to the `== null` calls inserted by null-aware desugaring. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 import 'dart:async'; 4 import 'dart:async';
5 import 'dart:convert'; 5 import 'dart:convert';
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 import 'package:front_end/src/base/instrumentation.dart'; 8 import 'package:front_end/src/base/instrumentation.dart';
9 import 'package:front_end/src/fasta/messages.dart'; 9 import 'package:front_end/src/fasta/messages.dart';
10 import 'package:front_end/src/fasta/scanner.dart'; 10 import 'package:front_end/src/fasta/scanner.dart';
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 } 149 }
150 } 150 }
151 } 151 }
152 } 152 }
153 } 153 }
154 154
155 @override 155 @override
156 void record( 156 void record(
157 Uri uri, int offset, String property, InstrumentationValue value) { 157 Uri uri, int offset, String property, InstrumentationValue value) {
158 uri = Uri.base.resolveUri(uri); 158 uri = Uri.base.resolveUri(uri);
159 if (offset == -1) {
160 throw _formatProblem(uri, 0, 'No offset for $property=$value', null);
161 }
159 var expectationsForUri = _unsatisfiedExpectations[uri]; 162 var expectationsForUri = _unsatisfiedExpectations[uri];
160 if (expectationsForUri == null) return; 163 if (expectationsForUri == null) return;
161 var expectationsAtOffset = expectationsForUri[offset]; 164 var expectationsAtOffset = expectationsForUri[offset];
162 if (expectationsAtOffset != null) { 165 if (expectationsAtOffset != null) {
163 for (int i = 0; i < expectationsAtOffset.length; i++) { 166 for (int i = 0; i < expectationsAtOffset.length; i++) {
164 var expectation = expectationsAtOffset[i]; 167 var expectation = expectationsAtOffset[i];
165 if (expectation.property == property) { 168 if (expectation.property == property) {
166 if (!value.matches(expectation.value)) { 169 if (!value.matches(expectation.value)) {
167 _problemWithStack( 170 _problemWithStack(
168 uri, 171 uri,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 this.property, this.value, this.commentOffset, this.commentLength); 241 this.property, this.value, this.commentOffset, this.commentLength);
239 } 242 }
240 243
241 class _Fix { 244 class _Fix {
242 final int offset; 245 final int offset;
243 final int length; 246 final int length;
244 final String replacement; 247 final String replacement;
245 248
246 _Fix(this.offset, this.length, this.replacement); 249 _Fix(this.offset, this.length, this.replacement);
247 } 250 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698