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

Side by Side Diff: pkg/barback/lib/src/errors.dart

Issue 267393009: Transition barback's infrastructure to an aggregate-based model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 barback.errors; 5 library barback.errors;
6 6
7 import 'package:stack_trace/stack_trace.dart'; 7 import 'package:stack_trace/stack_trace.dart';
8 8
9 import 'asset/asset_id.dart'; 9 import 'asset/asset_id.dart';
10 import 'transformer/transformer.dart'; 10 import 'transformer/wrapping_aggregate_transformer.dart';
11 import 'utils.dart'; 11 import 'utils.dart';
12 12
13 /// Error thrown when an asset with [id] cannot be found. 13 /// Error thrown when an asset with [id] cannot be found.
14 class AssetNotFoundException implements Exception { 14 class AssetNotFoundException implements Exception {
15 final AssetId id; 15 final AssetId id;
16 16
17 AssetNotFoundException(this.id); 17 AssetNotFoundException(this.id);
18 18
19 String toString() => "Could not find asset $id."; 19 String toString() => "Could not find asset $id.";
20 } 20 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 161
162 /// Information about a single transform in the barback graph. 162 /// Information about a single transform in the barback graph.
163 /// 163 ///
164 /// Identifies a single transformation in the barback graph. 164 /// Identifies a single transformation in the barback graph.
165 /// 165 ///
166 /// A transformation is uniquely identified by the ID of its primary input, and 166 /// A transformation is uniquely identified by the ID of its primary input, and
167 /// the transformer that is applied to it. 167 /// the transformer that is applied to it.
168 class TransformInfo { 168 class TransformInfo {
169 /// The transformer that's run for this transform. 169 /// The transformer that's run for this transform.
170 final Transformer transformer; 170 ///
171 /// This may be a [Transformer] or a [WrappingAggregateTransformer]. It may
172 /// also return additional types in the future.
Bob Nystrom 2014/05/08 20:30:48 I know we talked about this a bit before but I don
nweiz 2014/05/08 21:12:36 I think it's useful for users to be able to reliab
Bob Nystrom 2014/05/08 23:56:13 Maybe, but I think we could support that with myTr
nweiz 2014/05/19 21:11:09 I'm going to use the pain of backwards incompatibi
173 final transformer;
171 174
172 /// The id of this transform's primary asset. 175 /// The id of this transform's primary asset.
173 final AssetId primaryId; 176 final AssetId primaryId;
Bob Nystrom 2014/05/08 20:30:48 Mark this deprecated and add a String "key" getter
nweiz 2014/05/08 21:12:36 In the vast majority of cases this is going to be
174 177
175 TransformInfo(this.transformer, this.primaryId); 178 TransformInfo(transformer, this.primaryId)
179 : transformer = transformer is WrappingAggregateTransformer ?
180 transformer.transformer : transformer;
176 181
177 bool operator==(other) => 182 bool operator==(other) =>
178 other is TransformInfo && 183 other is TransformInfo &&
179 other.transformer == transformer && 184 other.transformer == transformer &&
180 other.primaryId == primaryId; 185 other.primaryId == primaryId;
181 186
182 int get hashCode => transformer.hashCode ^ primaryId.hashCode; 187 int get hashCode => transformer.hashCode ^ primaryId.hashCode;
183 188
184 String toString() => "$transformer on $primaryId"; 189 String toString() => "$transformer on $primaryId";
185 } 190 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698