Skip to content

Commit c98df62

Browse files
nshahancommit-bot@chromium.org
authored andcommitted
[CFE] Add comments to clarify source encoding and offsets
I mistakenly thought the offset would be the location in the List<int> source. Hopefully these comments will prevent confusion in the future. See: * https://dart-review.googlesource.com/c/sdk/+/124602 * #39271 Change-Id: Iba47b477d085c2a133ccd9aca645fe10906368bc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124591 Reviewed-by: Jens Johansen <[email protected]> Commit-Queue: Nicholas Shahan <[email protected]>
1 parent 1d65847 commit c98df62

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/kernel/lib/ast.dart

+9
Original file line numberDiff line numberDiff line change
@@ -4518,7 +4518,15 @@ class EmptyStatement extends Statement {
45184518
class AssertStatement extends Statement {
45194519
Expression condition;
45204520
Expression message; // May be null.
4521+
4522+
/// Character offset in the source where the assertion condition begins.
4523+
///
4524+
/// Note: This is not the offset into the UTF8 encoded `List<int>` source.
45214525
int conditionStartOffset;
4526+
4527+
/// Character offset in the source where the assertion condition ends.
4528+
///
4529+
/// Note: This is not the offset into the UTF8 encoded `List<int>` source.
45224530
int conditionEndOffset;
45234531

45244532
AssertStatement(this.condition,
@@ -7051,6 +7059,7 @@ class _ChildReplacer extends Transformer {
70517059
class Source {
70527060
final List<int> lineStarts;
70537061

7062+
/// A UTF8 encoding of the original source file.
70547063
final List<int> source;
70557064

70567065
final Uri importUri;

0 commit comments

Comments
 (0)