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

Side by Side Diff: pkg/code_transformers/test/resolver_test.dart

Issue 223553008: Only pass an AssetId to isPrimary and declareOutputs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix script_compactor Created 6 years, 8 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/test/entry_point_test.dart ('k') | pkg/observe/lib/transformer.dart » ('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.test.resolver_test; 5 library code_transformers.test.resolver_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:barback/barback.dart'; 9 import 'package:barback/barback.dart';
10 import 'package:code_transformers/resolver.dart'; 10 import 'package:code_transformers/resolver.dart';
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 347 }
348 348
349 class TestTransformer extends Transformer with ResolverTransformer { 349 class TestTransformer extends Transformer with ResolverTransformer {
350 final AssetId primary; 350 final AssetId primary;
351 final Function validator; 351 final Function validator;
352 352
353 TestTransformer(Resolvers resolvers, this.primary, this.validator) { 353 TestTransformer(Resolvers resolvers, this.primary, this.validator) {
354 this.resolvers = resolvers; 354 this.resolvers = resolvers;
355 } 355 }
356 356
357 Future<bool> isPrimary(Asset input) => 357 // TODO(nweiz): This should just take an AssetId when barback <0.13.0 support
358 new Future.value(input.id == primary); 358 // is dropped.
359 Future<bool> isPrimary(idOrAsset) {
360 var id = idOrAsset is AssetId ? idOrAsset : idOrAsset.id;
361 return new Future.value(id == primary);
362 }
359 363
360 applyResolver(Transform transform, Resolver resolver) => validator(resolver); 364 applyResolver(Transform transform, Resolver resolver) => validator(resolver);
361 } 365 }
OLDNEW
« no previous file with comments | « pkg/code_transformers/test/entry_point_test.dart ('k') | pkg/observe/lib/transformer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698