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

Unified Diff: sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart

Issue 24199004: Change pub tests and pub local server to use ipV4 localhost by address. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use pub serve 'hostname' option in tests of pub. Created 7 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/lib/src/barback/load_transformers.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart b/sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart
index b2c8464d451cdf4467f9eb0902cc6eeb8efa3797..2f8c6653c14b8a09af17ff26b96ab7589bb4fdc1 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart
@@ -25,7 +25,7 @@ import 'dart:isolate';
import 'dart:convert';
import 'dart:mirrors';
-import 'http://localhost:<<PORT>>/packages/barback/barback.dart';
+import 'http://<<HOST_AND_PORT>>/packages/barback/barback.dart';
/// Sets up the initial communication with the host isolate.
void main() {
@@ -47,7 +47,7 @@ Iterable<Transformer> initialize(Uri uri, Map configuration) {
var mirrors = currentMirrorSystem();
// TODO(nweiz): look this up by name once issue 5897 is fixed.
var transformerUri = Uri.parse(
- 'http://localhost:<<PORT>>/packages/barback/src/transformer.dart');
+ 'http://<<HOST_AND_PORT>>/packages/barback/src/transformer.dart');
var transformerClass = mirrors.libraries[transformerUri]
.classes[const Symbol('Transformer')];
@@ -288,10 +288,10 @@ Future<Set<Transformer>> loadTransformers(BarbackServer server,
TransformerId id) {
var path = id.asset.path.replaceFirst('lib/', '');
// TODO(nweiz): load from a "package:" URI when issue 12474 is fixed.
- var uri = 'http://localhost:${server.port}/packages/${id.asset.package}/'
- '$path';
+ var hostAndPort = '${server.host}:${server.port}';
+ var uri = 'http://$hostAndPort/packages/${id.asset.package}/$path';
var code = 'import "$uri";' +
- _TRANSFORMER_ISOLATE.replaceAll('<<PORT>>', server.port.toString());
+ _TRANSFORMER_ISOLATE.replaceAll('<<HOST_AND_PORT>>', hostAndPort);
log.fine("Loading transformers from ${id.asset}");
return dart.runInIsolate(code).then((sendPort) {
return _receiveFuture(sendPort.call({

Powered by Google App Engine
This is Rietveld 408576698