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

Unified Diff: lib/src/codegen/js_module_item_order.dart

Issue 1749213006: use Source.isInSystemLibrary (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: format Created 4 years, 10 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 | « no previous file | lib/src/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_module_item_order.dart
diff --git a/lib/src/codegen/js_module_item_order.dart b/lib/src/codegen/js_module_item_order.dart
index 8cffbacc796febda919c19832c34f619dc97ac8e..c62d9157226187fce37735c689ca3089d3b76013 100644
--- a/lib/src/codegen/js_module_item_order.dart
+++ b/lib/src/codegen/js_module_item_order.dart
@@ -212,9 +212,9 @@ class ModuleItemLoadOrder {
if (library == null) return true;
// The SDK is a special case: we optimize the order to prevent laziness.
- if (_isDartUri(library)) {
+ if (library.source.isInSystemLibrary) {
// SDK is loaded before non-SDK libraries
- if (!_isDartUri(_currentLibrary)) return true;
+ if (!_currentLibrary.source.isInSystemLibrary) return true;
// Compute the order of both SDK libraries. If unknown, assume it's after.
var order = corelibOrder.indexOf(library.source.uri);
@@ -239,7 +239,8 @@ class ModuleItemLoadOrder {
bool _inLibraryCycle(LibraryElement library) {
// SDK libs don't depend on things outside the SDK.
// (We can reach this via the recursive call below.)
- if (_isDartUri(library) && !_isDartUri(_currentLibrary)) return false;
+ if (library.source.isInSystemLibrary &&
+ !_currentLibrary.source.isInSystemLibrary) return false;
var result = _libraryCycleMemo[library];
if (result != null) return result;
@@ -256,10 +257,4 @@ class ModuleItemLoadOrder {
}
return _libraryCycleMemo[library] = result;
}
-
- /// Returns whether this is a library imported with 'dart:' URI.
- ///
- /// This is similar to [LibraryElement.isInSdk], but checking the URI instead
- /// of the library naming convention, because the URI is reliable.
- static bool _isDartUri(LibraryElement e) => e.source.uri.scheme == 'dart';
}
« no previous file with comments | « no previous file | lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698