Skip to content

Commit 240f1c9

Browse files
committed
[ Service ] Update protocol documentation
Clears up confusion around function/field owner locations not necessarily representing where the function/field was actually declared (e.g., for functions and fields brought into a class via a mixin application). Fixes #45093 TEST=Documentation change Change-Id: Ideaf17ec99d005459c60a2dd88f72b3485b32664 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240481 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>
1 parent f7ddabe commit 240f1c9

File tree

4 files changed

+58
-1
lines changed

4 files changed

+58
-1
lines changed

pkg/vm_service/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 8.2.2+1
4+
- Documentation update for `FieldRef` and `FuncRef`.
5+
36
## 8.2.2
47
- Updated the following optional fields to be nullable in `SocketStatistic`:
58
- `endTime`

pkg/vm_service/lib/src/vm_service.dart

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4302,6 +4302,9 @@ class FieldRef extends ObjRef {
43024302
String? name;
43034303

43044304
/// The owner of this field, which can be either a Library or a Class.
4305+
///
4306+
/// Note: the location of `owner` may not agree with `location` if this is a
4307+
/// field from a mixin application, patched class, etc.
43054308
ObjRef? owner;
43064309

43074310
/// The declared type of this field.
@@ -4320,6 +4323,9 @@ class FieldRef extends ObjRef {
43204323
bool? isStatic;
43214324

43224325
/// The location of this field in the source code.
4326+
///
4327+
/// Note: this may not agree with the location of `owner` if this is a field
4328+
/// from a mixin application, patched class, etc.
43234329
@optional
43244330
SourceLocation? location;
43254331

@@ -4386,6 +4392,9 @@ class Field extends Obj implements FieldRef {
43864392
String? name;
43874393

43884394
/// The owner of this field, which can be either a Library or a Class.
4395+
///
4396+
/// Note: the location of `owner` may not agree with `location` if this is a
4397+
/// field from a mixin application, patched class, etc.
43894398
ObjRef? owner;
43904399

43914400
/// The declared type of this field.
@@ -4404,6 +4413,9 @@ class Field extends Obj implements FieldRef {
44044413
bool? isStatic;
44054414

44064415
/// The location of this field in the source code.
4416+
///
4417+
/// Note: this may not agree with the location of `owner` if this is a field
4418+
/// from a mixin application, patched class, etc.
44074419
@optional
44084420
SourceLocation? location;
44094421

@@ -4630,6 +4642,10 @@ class FuncRef extends ObjRef {
46304642

46314643
/// The owner of this function, which can be a Library, Class, or a Function.
46324644
///
4645+
/// Note: the location of `owner` may not agree with `location` if this is a
4646+
/// function from a mixin application, expression evaluation, patched class,
4647+
/// etc.
4648+
///
46334649
/// [owner] can be one of [LibraryRef], [ClassRef] or [FuncRef].
46344650
dynamic owner;
46354651

@@ -4643,6 +4659,10 @@ class FuncRef extends ObjRef {
46434659
bool? implicit;
46444660

46454661
/// The location of this function in the source code.
4662+
///
4663+
/// Note: this may not agree with the location of `owner` if this is a
4664+
/// function from a mixin application, expression evaluation, patched class,
4665+
/// etc.
46464666
@optional
46474667
SourceLocation? location;
46484668

@@ -4706,6 +4726,10 @@ class Func extends Obj implements FuncRef {
47064726

47074727
/// The owner of this function, which can be a Library, Class, or a Function.
47084728
///
4729+
/// Note: the location of `owner` may not agree with `location` if this is a
4730+
/// function from a mixin application, expression evaluation, patched class,
4731+
/// etc.
4732+
///
47094733
/// [owner] can be one of [LibraryRef], [ClassRef] or [FuncRef].
47104734
dynamic owner;
47114735

@@ -4719,6 +4743,10 @@ class Func extends Obj implements FuncRef {
47194743
bool? implicit;
47204744

47214745
/// The location of this function in the source code.
4746+
///
4747+
/// Note: this may not agree with the location of `owner` if this is a
4748+
/// function from a mixin application, expression evaluation, patched class,
4749+
/// etc.
47224750
@optional
47234751
SourceLocation? location;
47244752

pkg/vm_service/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: >-
33
A library to communicate with a service implementing the Dart VM
44
service protocol.
55
6-
version: 8.2.2
6+
version: 8.2.2+1
77

88
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/vm_service
99

runtime/vm/service/service.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,6 +2446,9 @@ class @Field extends @Object {
24462446
24472447
// The owner of this field, which can be either a Library or a
24482448
// Class.
2449+
//
2450+
// Note: the location of `owner` may not agree with `location` if this is a field
2451+
// from a mixin application, patched class, etc.
24492452
@Object owner;
24502453
24512454
// The declared type of this field.
@@ -2464,6 +2467,9 @@ class @Field extends @Object {
24642467
bool static;
24652468
24662469
// The location of this field in the source code.
2470+
//
2471+
// Note: this may not agree with the location of `owner` if this is a field
2472+
// from a mixin application, patched class, etc.
24672473
SourceLocation location [optional];
24682474
}
24692475
```
@@ -2477,6 +2483,9 @@ class Field extends Object {
24772483
24782484
// The owner of this field, which can be either a Library or a
24792485
// Class.
2486+
//
2487+
// Note: the location of `owner` may not agree with `location` if this is a field
2488+
// from a mixin application, patched class, etc.
24802489
@Object owner;
24812490
24822491
// The declared type of this field.
@@ -2495,6 +2504,9 @@ class Field extends Object {
24952504
bool static;
24962505
24972506
// The location of this field in the source code.
2507+
//
2508+
// Note: this may not agree with the location of `owner` if this is a field
2509+
// from a mixin application, patched class, etc.
24982510
SourceLocation location [optional];
24992511
25002512
// The value of this field, if the field is static. If uninitialized,
@@ -2561,6 +2573,10 @@ class @Function extends @Object {
25612573
string name;
25622574
25632575
// The owner of this function, which can be a Library, Class, or a Function.
2576+
//
2577+
// Note: the location of `owner` may not agree with `location` if this is a
2578+
// function from a mixin application, expression evaluation, patched class,
2579+
// etc.
25642580
@Library|@Class|@Function owner;
25652581
25662582
// Is this function static?
@@ -2573,6 +2589,9 @@ class @Function extends @Object {
25732589
bool implicit;
25742590
25752591
// The location of this function in the source code.
2592+
//
2593+
// Note: this may not agree with the location of `owner` if this is a function
2594+
// from a mixin application, expression evaluation, patched class, etc.
25762595
SourceLocation location [optional];
25772596
}
25782597
```
@@ -2586,6 +2605,10 @@ class Function extends Object {
25862605
string name;
25872606
25882607
// The owner of this function, which can be a Library, Class, or a Function.
2608+
//
2609+
// Note: the location of `owner` may not agree with `location` if this is a
2610+
// function from a mixin application, expression evaluation, patched class,
2611+
// etc.
25892612
@Library|@Class|@Function owner;
25902613
25912614
// Is this function static?
@@ -2598,6 +2621,9 @@ class Function extends Object {
25982621
bool implicit;
25992622
26002623
// The location of this function in the source code.
2624+
//
2625+
// Note: this may not agree with the location of `owner` if this is a function
2626+
// from a mixin application, expression evaluation, patched class, etc.
26012627
SourceLocation location [optional];
26022628
26032629
// The signature of the function.

0 commit comments

Comments
 (0)