Remove deprecated APIs from dart:developer

Contributes to bug: https://github.com/dart-lang/sdk/issues/34233

Change-Id: I18f12b8c8da2ec444911128b96111e93df6c0496
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251767
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Michael Thomsen 2022-07-19 07:10:03 +00:00 committed by Commit Bot
parent 09680ec704
commit e15d639827
4 changed files with 17 additions and 24 deletions

View file

@ -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`

View file

@ -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);

View file

@ -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;

View file

@ -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);
}