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

Side by Side Diff: pkg/code_transformers/lib/src/resolvers.dart

Issue 217163005: Code transformers fixes for latest analyzer update (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: bumping version Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/code_transformers/lib/src/resolver_impl.dart ('k') | pkg/code_transformers/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library code_transformers.src.resolvers; 5 library code_transformers.src.resolvers;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'package:barback/barback.dart' show AssetId, Transformer, Transform; 8 import 'package:barback/barback.dart' show AssetId, Transformer, Transform;
9 9
10 import 'resolver.dart'; 10 import 'resolver.dart';
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 /// Helper function to make it easy to write an `Transformer.apply` method 61 /// Helper function to make it easy to write an `Transformer.apply` method
62 /// that automatically gets and releases the resolver. This is typically used 62 /// that automatically gets and releases the resolver. This is typically used
63 /// as follows: 63 /// as follows:
64 /// 64 ///
65 /// Future apply(Transform transform) { 65 /// Future apply(Transform transform) {
66 /// var entryPoints = ...; // compute entry points 66 /// var entryPoints = ...; // compute entry points
67 /// return applyToEntryPoints(transform, entryPoints); 67 /// return applyToEntryPoints(transform, entryPoints);
68 /// } 68 /// }
69 Future applyToEntryPoints(Transform transform, [List<AssetId> entryPoints]) { 69 Future applyToEntryPoints(Transform transform, [List<AssetId> entryPoints]) {
70 return resolvers.get(transform, entryPoints).then((resolver) { 70 return resolvers.get(transform, entryPoints).then((resolver) {
71 return new Future.value(applyResolver(transform, resolver)).then((_) { 71 return new Future(() => applyResolver(transform, resolver))
72 resolver.release(); 72 .whenComplete(() {
73 }); 73 resolver.release();
74 });
74 }); 75 });
75 } 76 }
76 77
77 /// Invoked when the resolver is ready to be processed. 78 /// Invoked when the resolver is ready to be processed.
78 /// 79 ///
79 /// Return a Future to indicate when apply is completed. 80 /// Return a Future to indicate when apply is completed.
80 applyResolver(Transform transform, Resolver resolver); 81 applyResolver(Transform transform, Resolver resolver);
81 } 82 }
OLDNEW
« no previous file with comments | « pkg/code_transformers/lib/src/resolver_impl.dart ('k') | pkg/code_transformers/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698