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

Unified Diff: packages/smoke/lib/src/default_transformer.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 | « packages/smoke/lib/src/common.dart ('k') | packages/smoke/lib/src/implementation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/smoke/lib/src/default_transformer.dart
diff --git a/packages/smoke/lib/src/default_transformer.dart b/packages/smoke/lib/src/default_transformer.dart
deleted file mode 100644
index 5c634a24e09f8de2ad22ae009889899875b59859..0000000000000000000000000000000000000000
--- a/packages/smoke/lib/src/default_transformer.dart
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2014, 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.
-
-/// Transformer that replaces the default mirror-based implementation of smoke,
-/// so that during deploy smoke doesn't include any dependency on dart:mirrors.
-library smoke.src.default_transformer;
-
-import 'dart:async';
-import 'package:barback/barback.dart';
-
-/// Replaces the default mirror-based implementation of smoke in
-/// `pacakge:smoke/implementation.dart`, so that during deploy smoke doesn't
-/// include any dependency on dart:mirrors.
-// TODO(sigmund): include tests that run this transformation automatically.
-class DefaultTransformer extends Transformer {
- DefaultTransformer.asPlugin();
-
- /// Only apply to `lib/src/implementation.dart`.
- // TODO(nweiz): This should just take an AssetId when barback <0.13.0 support
- // is dropped.
- Future<bool> isPrimary(idOrAsset) {
- var id = idOrAsset is AssetId ? idOrAsset : idOrAsset.id;
- return new Future.value(
- id.package == 'smoke' && id.path == 'lib/src/implementation.dart');
- }
-
- Future apply(Transform transform) {
- var id = transform.primaryInput.id;
- return transform.primaryInput.readAsString().then((code) {
- // Note: this rewrite is highly-coupled with how implementation.dart is
- // written. Make sure both are updated in sync.
- transform.addOutput(new Asset.fromString(id, code
- .replaceAll(
- new RegExp('new Reflective[^;]*;'), 'throwNotConfiguredError();')
- .replaceAll("import 'package:smoke/mirrors.dart';", '')));
- });
- }
-}
-
-/** Transformer phases which should be applied to the smoke package. */
-List<List<Transformer>> get phasesForSmoke =>
- [[new DefaultTransformer.asPlugin()]];
« no previous file with comments | « packages/smoke/lib/src/common.dart ('k') | packages/smoke/lib/src/implementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698