Skip to content

Commit 9a847a9

Browse files
bkonyicommit-bot@chromium.org
authored andcommitted
[ VM / Service ] Fix docs for @instance not including optional closureFunction and closureContext fields
Fixes #37989 Change-Id: I1e59dc9d27bc5c032d964207dca67bd8f4ce68ac Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115610 Reviewed-by: Gary Roumanis <[email protected]> Commit-Queue: Ben Konyi <[email protected]>
1 parent ff8b437 commit 9a847a9

File tree

4 files changed

+38
-34
lines changed

4 files changed

+38
-34
lines changed

pkg/vm_service/CHANGELOG.md

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

3+
## 1.1.2
4+
- Fixed issue where `closureFunction` and `closureContext` were only expected in
5+
`Instance` objects rather than `InstanceRef`.
6+
37
## 1.1.1
48
- Fixed issue serializing list arguments for certain VM service methods.
59
- Issue #37872

pkg/vm_service/lib/vm_service.dart

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3511,6 +3511,20 @@ class InstanceRef extends ObjRef {
35113511
@optional
35123512
InstanceRef pattern;
35133513

3514+
/// The function associated with a Closure instance.
3515+
///
3516+
/// Provided for instance kinds:
3517+
/// - Closure
3518+
@optional
3519+
FuncRef closureFunction;
3520+
3521+
/// The context associated with a Closure instance.
3522+
///
3523+
/// Provided for instance kinds:
3524+
/// - Closure
3525+
@optional
3526+
ContextRef closureContext;
3527+
35143528
InstanceRef();
35153529

35163530
InstanceRef._fromJson(Map<String, dynamic> json) : super._fromJson(json) {
@@ -3524,6 +3538,10 @@ class InstanceRef extends ObjRef {
35243538
parameterizedClass =
35253539
createServiceObject(json['parameterizedClass'], const ['ClassRef']);
35263540
pattern = createServiceObject(json['pattern'], const ['InstanceRef']);
3541+
closureFunction =
3542+
createServiceObject(json['closureFunction'], const ['FuncRef']);
3543+
closureContext =
3544+
createServiceObject(json['closureContext'], const ['ContextRef']);
35273545
}
35283546

35293547
@override
@@ -3542,6 +3560,8 @@ class InstanceRef extends ObjRef {
35423560
_setIfNotNull(json, 'typeClass', typeClass?.toJson());
35433561
_setIfNotNull(json, 'parameterizedClass', parameterizedClass?.toJson());
35443562
_setIfNotNull(json, 'pattern', pattern?.toJson());
3563+
_setIfNotNull(json, 'closureFunction', closureFunction?.toJson());
3564+
_setIfNotNull(json, 'closureContext', closureContext?.toJson());
35453565
return json;
35463566
}
35473567

@@ -3715,20 +3735,6 @@ class Instance extends Obj {
37153735
@optional
37163736
String bytes;
37173737

3718-
/// The function associated with a Closure instance.
3719-
///
3720-
/// Provided for instance kinds:
3721-
/// - Closure
3722-
@optional
3723-
FuncRef closureFunction;
3724-
3725-
/// The context associated with a Closure instance.
3726-
///
3727-
/// Provided for instance kinds:
3728-
/// - Closure
3729-
@optional
3730-
ContextRef closureContext;
3731-
37323738
/// The referent of a MirrorReference instance.
37333739
///
37343740
/// Provided for instance kinds:
@@ -3835,10 +3841,6 @@ class Instance extends Obj {
38353841
: new List<MapAssociation>.from(
38363842
_createSpecificObject(json['associations'], MapAssociation.parse));
38373843
bytes = json['bytes'];
3838-
closureFunction =
3839-
createServiceObject(json['closureFunction'], const ['FuncRef']);
3840-
closureContext =
3841-
createServiceObject(json['closureContext'], const ['ContextRef']);
38423844
mirrorReferent =
38433845
createServiceObject(json['mirrorReferent'], const ['InstanceRef']);
38443846
pattern = json['pattern'];
@@ -3878,8 +3880,6 @@ class Instance extends Obj {
38783880
_setIfNotNull(
38793881
json, 'associations', associations?.map((f) => f?.toJson())?.toList());
38803882
_setIfNotNull(json, 'bytes', bytes);
3881-
_setIfNotNull(json, 'closureFunction', closureFunction?.toJson());
3882-
_setIfNotNull(json, 'closureContext', closureContext?.toJson());
38833883
_setIfNotNull(json, 'mirrorReferent', mirrorReferent?.toJson());
38843884
_setIfNotNull(json, 'pattern', pattern);
38853885
_setIfNotNull(json, 'isCaseSensitive', isCaseSensitive);

pkg/vm_service/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: vm_service
22
description: >-
33
A library to communicate with a service implementing the Dart VM
44
service protocol.
5-
version: 1.1.1
5+
version: 1.1.2
66

77
author: Dart Team <[email protected]>
88
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/vm_service

runtime/vm/service/service.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> Please post feedback to the [observatory-discuss group][discuss-list]
44
5-
This document describes of _version 3.25_ of the Dart VM Service Protocol. This
5+
This document describes of _version 3.26_ of the Dart VM Service Protocol. This
66
protocol is used to communicate with a running Dart Virtual Machine.
77

88
To use the Service Protocol, start the VM with the *--observe* flag.
@@ -2088,6 +2088,18 @@ class @Instance extends @Object {
20882088
// Provided for instance kinds:
20892089
// RegExp
20902090
@Instance pattern [optional];
2091+
2092+
// The function associated with a Closure instance.
2093+
//
2094+
// Provided for instance kinds:
2095+
// Closure
2096+
@Function closureFunction [optional];
2097+
2098+
// The context associated with a Closure instance.
2099+
//
2100+
// Provided for instance kinds:
2101+
// Closure
2102+
@Context closureContext [optional];
20912103
}
20922104
```
20932105

@@ -2239,18 +2251,6 @@ class Instance extends Object {
22392251
// Float64x2List
22402252
string bytes [optional];
22412253
2242-
// The function associated with a Closure instance.
2243-
//
2244-
// Provided for instance kinds:
2245-
// Closure
2246-
@Function closureFunction [optional];
2247-
2248-
// The context associated with a Closure instance.
2249-
//
2250-
// Provided for instance kinds:
2251-
// Closure
2252-
@Context closureContext [optional];
2253-
22542254
// The referent of a MirrorReference instance.
22552255
//
22562256
// Provided for instance kinds:

0 commit comments

Comments
 (0)