Skip to content

Commit

Permalink
[ VM / Service ] Fix docs for @instance not including optional closur…
Browse files Browse the repository at this point in the history
…eFunction and closureContext fields

Fixes dart-lang/sdk#37989

Change-Id: I1e59dc9d27bc5c032d964207dca67bd8f4ce68ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115610
Reviewed-by: Gary Roumanis <grouma@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
  • Loading branch information
bkonyi authored and commit-bot@chromium.org committed Sep 5, 2019
1 parent ff8b437 commit 9a847a9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 34 deletions.
4 changes: 4 additions & 0 deletions pkg/vm_service/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.1.2
- Fixed issue where `closureFunction` and `closureContext` were only expected in
`Instance` objects rather than `InstanceRef`.

## 1.1.1
- Fixed issue serializing list arguments for certain VM service methods.
- Issue #37872
Expand Down
40 changes: 20 additions & 20 deletions pkg/vm_service/lib/vm_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3511,6 +3511,20 @@ class InstanceRef extends ObjRef {
@optional
InstanceRef pattern;

/// The function associated with a Closure instance.
///
/// Provided for instance kinds:
/// - Closure
@optional
FuncRef closureFunction;

/// The context associated with a Closure instance.
///
/// Provided for instance kinds:
/// - Closure
@optional
ContextRef closureContext;

InstanceRef();

InstanceRef._fromJson(Map<String, dynamic> json) : super._fromJson(json) {
Expand All @@ -3524,6 +3538,10 @@ class InstanceRef extends ObjRef {
parameterizedClass =
createServiceObject(json['parameterizedClass'], const ['ClassRef']);
pattern = createServiceObject(json['pattern'], const ['InstanceRef']);
closureFunction =
createServiceObject(json['closureFunction'], const ['FuncRef']);
closureContext =
createServiceObject(json['closureContext'], const ['ContextRef']);
}

@override
Expand All @@ -3542,6 +3560,8 @@ class InstanceRef extends ObjRef {
_setIfNotNull(json, 'typeClass', typeClass?.toJson());
_setIfNotNull(json, 'parameterizedClass', parameterizedClass?.toJson());
_setIfNotNull(json, 'pattern', pattern?.toJson());
_setIfNotNull(json, 'closureFunction', closureFunction?.toJson());
_setIfNotNull(json, 'closureContext', closureContext?.toJson());
return json;
}

Expand Down Expand Up @@ -3715,20 +3735,6 @@ class Instance extends Obj {
@optional
String bytes;

/// The function associated with a Closure instance.
///
/// Provided for instance kinds:
/// - Closure
@optional
FuncRef closureFunction;

/// The context associated with a Closure instance.
///
/// Provided for instance kinds:
/// - Closure
@optional
ContextRef closureContext;

/// The referent of a MirrorReference instance.
///
/// Provided for instance kinds:
Expand Down Expand Up @@ -3835,10 +3841,6 @@ class Instance extends Obj {
: new List<MapAssociation>.from(
_createSpecificObject(json['associations'], MapAssociation.parse));
bytes = json['bytes'];
closureFunction =
createServiceObject(json['closureFunction'], const ['FuncRef']);
closureContext =
createServiceObject(json['closureContext'], const ['ContextRef']);
mirrorReferent =
createServiceObject(json['mirrorReferent'], const ['InstanceRef']);
pattern = json['pattern'];
Expand Down Expand Up @@ -3878,8 +3880,6 @@ class Instance extends Obj {
_setIfNotNull(
json, 'associations', associations?.map((f) => f?.toJson())?.toList());
_setIfNotNull(json, 'bytes', bytes);
_setIfNotNull(json, 'closureFunction', closureFunction?.toJson());
_setIfNotNull(json, 'closureContext', closureContext?.toJson());
_setIfNotNull(json, 'mirrorReferent', mirrorReferent?.toJson());
_setIfNotNull(json, 'pattern', pattern);
_setIfNotNull(json, 'isCaseSensitive', isCaseSensitive);
Expand Down
2 changes: 1 addition & 1 deletion pkg/vm_service/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: vm_service
description: >-
A library to communicate with a service implementing the Dart VM
service protocol.
version: 1.1.1
version: 1.1.2

author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/vm_service
Expand Down
26 changes: 13 additions & 13 deletions runtime/vm/service/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

To use the Service Protocol, start the VM with the *--observe* flag.
Expand Down Expand Up @@ -2088,6 +2088,18 @@ class @Instance extends @Object {
// Provided for instance kinds:
// RegExp
@Instance pattern [optional];
// The function associated with a Closure instance.
//
// Provided for instance kinds:
// Closure
@Function closureFunction [optional];
// The context associated with a Closure instance.
//
// Provided for instance kinds:
// Closure
@Context closureContext [optional];
}
```

Expand Down Expand Up @@ -2239,18 +2251,6 @@ class Instance extends Object {
// Float64x2List
string bytes [optional];
// The function associated with a Closure instance.
//
// Provided for instance kinds:
// Closure
@Function closureFunction [optional];
// The context associated with a Closure instance.
//
// Provided for instance kinds:
// Closure
@Context closureContext [optional];
// The referent of a MirrorReference instance.
//
// Provided for instance kinds:
Expand Down

0 comments on commit 9a847a9

Please sign in to comment.