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

Unified Diff: sdk/lib/_internal/lib/js_helper.dart

Issue 429883002: Remove support for the DeferredLibrary annotation and remove tests of it (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Deprecated until sdk 1.8 remove cruft from unused DeferredLibrary 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
« no previous file with comments | « sdk/lib/_internal/lib/async_patch.dart ('k') | sdk/lib/async/deferred_load.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/js_helper.dart
diff --git a/sdk/lib/_internal/lib/js_helper.dart b/sdk/lib/_internal/lib/js_helper.dart
index bd1513697f175ea84a08ed0aa79aac2e3733c375..b01292de74147c8c7952edf341bb866c504ea083 100644
--- a/sdk/lib/_internal/lib/js_helper.dart
+++ b/sdk/lib/_internal/lib/js_helper.dart
@@ -3231,19 +3231,19 @@ LoadLibraryFunctionType _loadLibraryWrapper(String loadId) {
final Map<String, Future<Null>> _loadingLibraries = <String, Future<Null>>{};
final Set<String> _loadedLibraries = new Set<String>();
-Future<Null> loadDeferredLibrary(String loadId, [String uri]) {
+Future<Null> loadDeferredLibrary(String loadId) {
List<List<String>> hunkLists = JS('JSExtendableArray|Null',
'\$.libraries_to_load[#]', loadId);
if (hunkLists == null) return new Future.value(null);
return Future.forEach(hunkLists, (hunkNames) {
Iterable<Future<Null>> allLoads =
- hunkNames.map((hunkName) => _loadHunk(hunkName, uri));
+ hunkNames.map((hunkName) => _loadHunk(hunkName));
return Future.wait(allLoads).then((_) => null);
}).then((_) => _loadedLibraries.add(loadId));
}
-Future<Null> _loadHunk(String hunkName, String uri) {
+Future<Null> _loadHunk(String hunkName) {
// TODO(ahe): Validate libraryName. Kasper points out that you want
// to be able to experiment with the effect of toggling @DeferLoad,
// so perhaps we should silently ignore "bad" library names.
@@ -3252,9 +3252,8 @@ Future<Null> _loadHunk(String hunkName, String uri) {
return future.then((_) => null);
}
- if (uri == null) {
- uri = IsolateNatives.thisScript;
- }
+ String uri = IsolateNatives.thisScript;
+
int index = uri.lastIndexOf('/');
uri = '${uri.substring(0, index + 1)}$hunkName';
« no previous file with comments | « sdk/lib/_internal/lib/async_patch.dart ('k') | sdk/lib/async/deferred_load.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698