[dart2js] Fix minor bug in regenerating annotations.

Change-Id: Ia6b5a2cef3815b000f5a88f5560ca0782fb7b53c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206561
Auto-Submit: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
Joshua Litt 2021-07-12 17:40:15 +00:00 committed by commit-bot@chromium.org
parent 624ccd30f8
commit 727207910b

View file

@ -17,7 +17,7 @@ export 'package:front_end/src/testing/id_extractor.dart';
SourceSpan computeSourceSpanFromUriOffset(Uri uri, int offset) {
if (uri != null) {
if (offset != null) {
if (offset != null && offset != -1) {
return new SourceSpan(uri, offset, offset + 1);
} else {
return new SourceSpan(uri, 0, 0);