[3.0 alpha] Remove deprecated dart:async APIs

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

Change-Id: Ib70efd0f388f50686e1745ca5237d06a4538a870
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268460
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
This commit is contained in:
Michael Thomsen 2022-12-12 09:35:29 +00:00
parent e2eb4cf23f
commit d6b40b0926
6 changed files with 10 additions and 57 deletions

View file

@ -9,6 +9,16 @@
removed. See [#49536](https://github.com/dart-lang/sdk/issues/49536) for
details.
#### `dart:async`
- **Breaking change** [#49529][]:
- Removed the deprecated [`DeferredLibrary`][] class.
Use the [`deferred as`][] import syntax instead.
[#49529]: https://github.com/dart-lang/sdk/issues/49529
[`DeferredLibrary`]: https://api.dart.dev/stable/2.18.4/dart-async/DeferredLibrary-class.html
[`deferred as`]: https://dart.dev/guides/language/language-tour#deferred-loading
## 2.19.0
### Language

View file

@ -168,15 +168,6 @@ class _AsyncRun {
}
}
@patch
class DeferredLibrary {
@patch
Future<Null> load() {
throw 'DeferredLibrary not supported. '
'please use the `import "lib.dart" deferred as lib` syntax.';
}
}
@patch
class Timer {
@patch

View file

@ -91,15 +91,6 @@ class _AsyncRun {
}
}
@patch
class DeferredLibrary {
@patch
Future<Null> load() {
throw 'DeferredLibrary not supported. '
'please use the `import "lib.dart" deferred as lib` syntax.';
}
}
@patch
class Timer {
@patch

View file

@ -10,7 +10,6 @@
import "dart:_internal" show VMLibraryHooks, patch, unsafeCast;
/// These are the additional parts of this patch library:
part "deferred_load_patch.dart";
part "schedule_microtask_patch.dart";
part "timer_patch.dart";

View file

@ -1,19 +0,0 @@
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
part of "async_patch.dart";
final Set<String> _loadedLibraries = new Set<String>();
@patch
class DeferredLibrary {
@patch
Future<Null> load() {
// Dummy implementation that should eventually be replaced by real
// implementation.
Future<Null> future = new Future<Null>.value(null);
_loadedLibraries.add(libraryName);
return future;
}
}

View file

@ -4,25 +4,6 @@
part of dart.async;
/// Indicates that loading of [libraryName] is deferred.
///
/// This class is obsolete. Instead prefer the `deferred as` import directive
/// syntax.
/// ```
@Deprecated("Dart sdk v. 1.8")
class DeferredLibrary {
final String libraryName;
final String? uri;
const DeferredLibrary(this.libraryName, {this.uri});
/// Ensure that [libraryName] has been loaded.
///
/// If the library fails to load, the [Future] will complete with a
/// [DeferredLoadException].
external Future<Null> load();
}
/// Thrown when a deferred library fails to load.
class DeferredLoadException implements Exception {
DeferredLoadException(String message) : _s = message;