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

Unified Diff: sdk/lib/_internal/pub_generated/lib/src/barback/rewrite_import_transformer.dart

Issue 557563002: Store the async-await compiled pub code directly in the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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
Index: sdk/lib/_internal/pub_generated/lib/src/barback/rewrite_import_transformer.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/rewrite_import_transformer.dart b/sdk/lib/_internal/pub_generated/lib/src/barback/rewrite_import_transformer.dart
similarity index 56%
copy from sdk/lib/_internal/pub/lib/src/barback/rewrite_import_transformer.dart
copy to sdk/lib/_internal/pub_generated/lib/src/barback/rewrite_import_transformer.dart
index 7482d620a840df40be7a5ecdb6c093888f231a6a..bea129efbedb2acd2bd9960cac5ea6294d512c49 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/rewrite_import_transformer.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/barback/rewrite_import_transformer.dart
@@ -1,38 +1,24 @@
-// Copyright (c) 2013, 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 pub.rewrite_import_transformer;
-
import 'dart:async';
-
import 'package:barback/barback.dart';
-
import '../dart.dart';
-
-/// A transformer used internally to rewrite "package:" imports so they point to
-/// the barback server rather than to pub's package root.
class RewriteImportTransformer extends Transformer {
String get allowedExtensions => '.dart';
-
Future apply(Transform transform) {
return transform.primaryInput.readAsString().then((contents) {
- var directives = parseImportsAndExports(contents,
- name: transform.primaryInput.id.toString());
-
+ var directives =
+ parseImportsAndExports(contents, name: transform.primaryInput.id.toString());
var buffer = new StringBuffer();
var index = 0;
for (var directive in directives) {
var uri = Uri.parse(directive.uri.stringValue);
if (uri.scheme != 'package') continue;
-
buffer
- ..write(contents.substring(index, directive.uri.literal.offset))
- ..write('"/packages/${uri.path}"');
+ ..write(contents.substring(index, directive.uri.literal.offset))
+ ..write('"/packages/${uri.path}"');
index = directive.uri.literal.end;
}
buffer.write(contents.substring(index, contents.length));
-
transform.addOutput(
new Asset.fromString(transform.primaryInput.id, buffer.toString()));
});

Powered by Google App Engine
This is Rietveld 408576698