b8d85b7ad3
Add annotations
@pragma('dart2js:load-priority:normal')
@pragma('dart2js:load-priority:high')
The test shows that these annotations are scoped.
This CL is just plumbing the annotation through as an argument to the runtime call to the code that implements `loadLibrary()`. Actual prioritization is not yet implemented.
Change-Id: Iff1404baf34192139dab95e2dbb01c2d4e8dae45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270283
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
20 lines
721 B
Dart
20 lines
721 B
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.
|
|
|
|
/// Annotation values for `@pragma('dart2js:load-priority:xxx')` annotations.
|
|
enum LoadLibraryPriority {
|
|
// Order is important as it is the `index` of the enum that is passed to the
|
|
// runtime helper.
|
|
|
|
// Normal priority, if there is no `dart2js:load-priority:xxx` annotation.
|
|
normal,
|
|
|
|
// High priority.
|
|
high,
|
|
|
|
// TODO(sra): Do we want more priorities, e.g. "background", where the loader
|
|
// defers any work until the next microtask, and is conservative about
|
|
// initialization jank.
|
|
}
|