Files
sdk/pkg/compiler/test/annotations/data/deferred.dart
T
Lasse R.H. Nielsen 511bf8a80f Add nonNulls, indexed and other extensions on iterables.
Also adds `firstOrNull`, `lastOrNull`, `singleOrNull`, and `elementAtOrNull`.

I chose `nonNulls` instead of `whereNotNull()`.
The latter should have been a getter, but isn't.
Making it a getter in the platform libraries would be confusing,
and make migrating from `package:collection`'s function harder,
so instead I gave it a completely new name.
The alternative would be to retain the non-idiomatic `whereNotNull()`
for familiarity. But then it would be tool late to fix.



Fixes #49928

BUG= https://github.com/dart-lang/sdk/issues/49928

CoreLibraryReviewExempt: Everybody's on vacation, everybody everywhere.
Change-Id: If464e3bd6bc97cbeefc3e5084b4cbaadac3f1e95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290760
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-04-04 23:05:54 +00:00

64 lines
2.2 KiB
Dart

// Copyright (c) 2022, 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.
import 'dart:collection' deferred as normal show HashSet;
@pragma('dart2js:load-priority:high')
import 'dart:math' deferred as high;
test1() async {
await normal. /*spec.invoke: normal*/ loadLibrary();
await high. /*spec.invoke: high*/ loadLibrary();
@pragma('dart2js:load-priority:normal')
final _1 = await normal. /*spec.invoke: normal*/ loadLibrary();
@pragma('dart2js:load-priority:normal')
final _2 = await normal. /*spec.invoke: normal*/ loadLibrary();
@pragma('dart2js:load-priority:high')
final _3 = await normal. /*spec.invoke: high*/ loadLibrary();
@pragma('dart2js:load-priority:high')
final _4 = await normal. /*spec.invoke: high*/ loadLibrary();
}
@pragma('dart2js:load-priority:high')
/*spec.member: testHigh:load-priority:high*/
testHigh() async {
await normal. /*spec.invoke: high*/ loadLibrary();
await high. /*spec.invoke: high*/ loadLibrary();
@pragma('dart2js:load-priority:normal')
final _1 = await normal. /*spec.invoke: normal*/ loadLibrary();
@pragma('dart2js:load-priority:normal')
final _2 = await normal. /*spec.invoke: normal*/ loadLibrary();
@pragma('dart2js:load-priority:high')
final _3 = await normal. /*spec.invoke: high*/ loadLibrary();
@pragma('dart2js:load-priority:high')
final _4 = await normal. /*spec.invoke: high*/ loadLibrary();
}
@pragma('dart2js:load-priority:normal')
/*spec.member: testNormal:load-priority:normal*/
testNormal() async {
await normal. /*spec.invoke: normal*/ loadLibrary();
await high. /*spec.invoke: normal*/ loadLibrary();
@pragma('dart2js:load-priority:normal')
final _1 = await normal. /*spec.invoke: normal*/ loadLibrary();
@pragma('dart2js:load-priority:normal')
final _2 = await normal. /*spec.invoke: normal*/ loadLibrary();
@pragma('dart2js:load-priority:high')
final _3 = await normal. /*spec.invoke: high*/ loadLibrary();
@pragma('dart2js:load-priority:high')
final _4 = await normal. /*spec.invoke: high*/ loadLibrary();
}
main() async {
await test1();
await testHigh();
await testNormal();
}