diff --git a/pkg/vm_service/CHANGELOG.md b/pkg/vm_service/CHANGELOG.md index b62301be59d5..fb32fdf3ebd9 100644 --- a/pkg/vm_service/CHANGELOG.md +++ b/pkg/vm_service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 15.0.0 +- Update type of `CodeRef.function` from `FuncRef` to `dynamic` to allow for `NativeFunction` + functions ([flutter/devtools #8567]). + +[flutter/devtools #8567]: https://github.com/flutter/devtools/issues/8567 + ## 14.3.1 - Fix crash that could occur when trying to send a service extension response after the service connection had already been disposed of ([flutter/flutter #157296]). diff --git a/pkg/vm_service/lib/src/vm_service.dart b/pkg/vm_service/lib/src/vm_service.dart index 4cbfdc846017..dc2872b30f5e 100644 --- a/pkg/vm_service/lib/src/vm_service.dart +++ b/pkg/vm_service/lib/src/vm_service.dart @@ -3205,8 +3205,10 @@ class CodeRef extends ObjRef { /*CodeKind*/ String? kind; /// This code object's corresponding function. + /// + /// [function] can be one of [FuncRef] or [NativeFunction]. @optional - FuncRef? function; + dynamic function; CodeRef({ this.name, @@ -3220,8 +3222,8 @@ class CodeRef extends ObjRef { CodeRef._fromJson(Map json) : super._fromJson(json) { name = json['name'] ?? ''; kind = json['kind'] ?? ''; - function = - createServiceObject(json['function'], const ['FuncRef']) as FuncRef?; + function = createServiceObject( + json['function'], const ['FuncRef', 'NativeFunction']) as dynamic; } @override @@ -3261,9 +3263,11 @@ class Code extends Obj implements CodeRef { /*CodeKind*/ String? kind; /// This code object's corresponding function. + /// + /// [function] can be one of [FuncRef] or [NativeFunction]. @optional @override - FuncRef? function; + dynamic function; Code({ this.name, @@ -3277,8 +3281,8 @@ class Code extends Obj implements CodeRef { Code._fromJson(Map json) : super._fromJson(json) { name = json['name'] ?? ''; kind = json['kind'] ?? ''; - function = - createServiceObject(json['function'], const ['FuncRef']) as FuncRef?; + function = createServiceObject( + json['function'], const ['FuncRef', 'NativeFunction']) as dynamic; } @override diff --git a/pkg/vm_service/pubspec.yaml b/pkg/vm_service/pubspec.yaml index 9c29eea3d284..9e7519e3ef4e 100644 --- a/pkg/vm_service/pubspec.yaml +++ b/pkg/vm_service/pubspec.yaml @@ -1,5 +1,5 @@ name: vm_service -version: 14.3.1 +version: 15.0.0 description: >- A library to communicate with a service implementing the Dart VM service protocol. diff --git a/runtime/vm/service/service.md b/runtime/vm/service/service.md index 2f3a715d8d21..d21b5d772542 100644 --- a/runtime/vm/service/service.md +++ b/runtime/vm/service/service.md @@ -2228,7 +2228,7 @@ class @Code extends @Object { CodeKind kind; // This code object's corresponding function. - @Function function [optional]; + @Function|NativeFunction function [optional]; } ``` @@ -2243,7 +2243,7 @@ class Code extends Object { CodeKind kind; // This code object's corresponding function. - @Function function [optional]; + @Function|NativeFunction function [optional]; } ```