diff --git a/CHANGELOG.md b/CHANGELOG.md index 7438d5d86d98..980d2387bea1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2489,6 +2489,15 @@ breaking changes: #### `dart:developer` +- **Breaking change** [#34233][]: The previously deprecated APIs + `kInvalidParams`, `kExtensionError`, `kExtensionErrorMax`, and + `kExtensionErrorMin` in [`ServiceExtensionResponse`][] have been removed. They + have been replaced by `invalidParams`, `extensionError`, `extensionErrorMax`, + and `extensionErrorMin`. + +[#34233]: https://github.com/dart-lang/sdk/issues/34233 +[`ServiceExtensionResponse`]: https://api.dart.dev/stable/dart-developer/ServiceExtensionResponse-class.html#constants + - The constructors for `TimelineTask` now accept an optional `filterKey` parameter. If provided, the arguments for all events associated with the task will contain an entry named `filterKey`, set to the value of the `filterKey` diff --git a/sdk/lib/_internal/vm/lib/developer.dart b/sdk/lib/_internal/vm/lib/developer.dart index 46d050795d4f..3a78b32588d0 100644 --- a/sdk/lib/_internal/vm/lib/developer.dart +++ b/sdk/lib/_internal/vm/lib/developer.dart @@ -88,13 +88,13 @@ _runExtension( } catch (e, st) { var errorDetails = (st == null) ? '$e' : '$e\n$st'; response = new ServiceExtensionResponse.error( - ServiceExtensionResponse.kExtensionError, errorDetails); + ServiceExtensionResponse.extensionError, errorDetails); _postResponse(replyPort, id, response, trace_service); return; } if (response is! Future) { response = new ServiceExtensionResponse.error( - ServiceExtensionResponse.kExtensionError, + ServiceExtensionResponse.extensionError, "Extension handler must return a Future"); _postResponse(replyPort, id, response, trace_service); return; @@ -103,13 +103,13 @@ _runExtension( // Catch any errors eagerly and wrap them in a ServiceExtensionResponse. var errorDetails = (st == null) ? '$e' : '$e\n$st'; return new ServiceExtensionResponse.error( - ServiceExtensionResponse.kExtensionError, errorDetails); + ServiceExtensionResponse.extensionError, errorDetails); }).then((response) { // Post the valid response or the wrapped error after verifying that // the response is a ServiceExtensionResponse. if (response is! ServiceExtensionResponse) { response = new ServiceExtensionResponse.error( - ServiceExtensionResponse.kExtensionError, + ServiceExtensionResponse.extensionError, "Extension handler must complete to a ServiceExtensionResponse"); } _postResponse(replyPort, id, response, trace_service); diff --git a/sdk/lib/developer/extension.dart b/sdk/lib/developer/extension.dart index aa106744ced0..ceef2d8ab8d9 100644 --- a/sdk/lib/developer/extension.dart +++ b/sdk/lib/developer/extension.dart @@ -45,22 +45,6 @@ class ServiceExtensionResponse { checkNotNullable(errorDetail, "errorDetail"); } - /// Invalid method parameter(s) error code. - @deprecated - static const kInvalidParams = invalidParams; - - /// Generic extension error code. - @deprecated - static const kExtensionError = extensionError; - - /// Maximum extension provided error code. - @deprecated - static const kExtensionErrorMax = extensionErrorMax; - - /// Minimum extension provided error code. - @deprecated - static const kExtensionErrorMin = extensionErrorMin; - /// Invalid method parameter(s) error code. static const invalidParams = -32602; diff --git a/tests/lib/fix_data_tests/developer.dart b/tests/lib/fix_data_tests/developer.dart index a9dc42b180ae..6f4d9d59d9be 100644 --- a/tests/lib/fix_data_tests/developer.dart +++ b/tests/lib/fix_data_tests/developer.dart @@ -5,8 +5,8 @@ import 'dart:developer'; void main() { - print(ServiceExtensionResponse.kInvalidParams); - print(ServiceExtensionResponse.kExtensionError); - print(ServiceExtensionResponse.kExtensionErrorMax); - print(ServiceExtensionResponse.kExtensionErrorMin); + print(ServiceExtensionResponse.invalidParams); + print(ServiceExtensionResponse.extensionError); + print(ServiceExtensionResponse.extensionErrorMax); + print(ServiceExtensionResponse.extensionErrorMin); }