Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2032)

Unified Diff: initialize/lib/src/static_loader.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « initialize/lib/src/mirror_loader.dart ('k') | initialize/lib/transformer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: initialize/lib/src/static_loader.dart
diff --git a/initialize/lib/src/static_loader.dart b/initialize/lib/src/static_loader.dart
deleted file mode 100644
index edc679ba578232434665616be0bac776acf5f5bb..0000000000000000000000000000000000000000
--- a/initialize/lib/src/static_loader.dart
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2015, 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.
-library initialize.static_loader;
-
-import 'dart:collection' show Queue;
-import 'package:initialize/initialize.dart';
-
-/// This represents an annotation/declaration pair.
-class InitEntry<T> {
- /// The annotation instance.
- final Initializer<T> meta;
-
- /// The target of the annotation to pass to initialize.
- final T target;
-
- InitEntry(this.meta, this.target);
-}
-
-/// Set of initializers that are invoked by `run`. This is initialized with
-/// code automatically generated by the transformer.
-Queue<InitEntry> initializers = new Queue<InitEntry>();
-
-/// Returns initializer functions matching the supplied filters and removes them
-/// from `initializers` so they won't be ran again.
-Queue<Function> loadInitializers(
- {List<Type> typeFilter, InitializerFilter customFilter, Uri from}) {
- if (from != null) {
- throw 'The `from` option is not supported in deploy mode.';
- }
- Queue<Function> result = new Queue<Function>();
-
- var matchesFilters = (initializer) {
- if (typeFilter != null &&
- !typeFilter.any((t) => initializer.meta.runtimeType == t)) {
- return false;
- }
- if (customFilter != null && !customFilter(initializer.meta)) {
- return false;
- }
- return true;
- };
-
- result.addAll(initializers
- .where(matchesFilters)
- .map((i) => () => i.meta.initialize(i.target)));
-
- initializers.removeWhere(matchesFilters);
-
- return result;
-}
« no previous file with comments | « initialize/lib/src/mirror_loader.dart ('k') | initialize/lib/transformer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698