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

Side by Side Diff: pkg/compiler/lib/src/library_loader.dart

Issue 1517013003: Revert "dart2js: add support for configuration-specific imports." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 dart2js.library_loader; 5 library dart2js.library_loader;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'common.dart'; 9 import 'common.dart';
10 import 'common/names.dart' show 10 import 'common/names.dart' show
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 bool importsDartCore = false; 378 bool importsDartCore = false;
379 LinkBuilder<LibraryDependencyElementX> libraryDependencies = 379 LinkBuilder<LibraryDependencyElementX> libraryDependencies =
380 new LinkBuilder<LibraryDependencyElementX>(); 380 new LinkBuilder<LibraryDependencyElementX>();
381 Uri base = library.entryCompilationUnit.script.readableUri; 381 Uri base = library.entryCompilationUnit.script.readableUri;
382 382
383 return Future.forEach(library.tags, (LibraryTag tag) { 383 return Future.forEach(library.tags, (LibraryTag tag) {
384 return reporter.withCurrentElement(library, () { 384 return reporter.withCurrentElement(library, () {
385 385
386 Uri computeUri(LibraryDependency node) { 386 Uri computeUri(LibraryDependency node) {
387 StringNode uriNode = node.uri; 387 String tagUriString = node.uri.dartString.slowToString();
388 if (node.conditionalUris != null) {
389 for (ConditionalUri conditionalUri in node.conditionalUris) {
390 String key = conditionalUri.key.slowNameString;
391 String value = conditionalUri.value == null
392 ? "true"
393 : conditionalUri.value.dartString.slowToString();
394 String actual = compiler.fromEnvironment(key);
395 if (value == actual) {
396 uriNode = conditionalUri.uri;
397 break;
398 }
399 }
400 }
401 String tagUriString = uriNode.dartString.slowToString();
402 try { 388 try {
403 return Uri.parse(tagUriString); 389 return Uri.parse(tagUriString);
404 } on FormatException { 390 } on FormatException {
405 reporter.reportErrorMessage( 391 reporter.reportErrorMessage(
406 node.uri, 392 node.uri,
407 MessageKind.INVALID_URI, {'uri': tagUriString}); 393 MessageKind.INVALID_URI, {'uri': tagUriString});
408 return null; 394 return null;
409 } 395 }
410 } 396 }
411 397
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 } 1355 }
1370 suffixes.add(const Link<Uri>().prepend(canonicalUri)); 1356 suffixes.add(const Link<Uri>().prepend(canonicalUri));
1371 } 1357 }
1372 suffixChainMap[library] = suffixes; 1358 suffixChainMap[library] = suffixes;
1373 return; 1359 return;
1374 } 1360 }
1375 1361
1376 computeSuffixes(rootLibrary, const Link<Uri>()); 1362 computeSuffixes(rootLibrary, const Link<Uri>());
1377 } 1363 }
1378 } 1364 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dart2js.dart ('k') | pkg/compiler/lib/src/parser/class_element_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698