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

Side by Side Diff: pkg/polymer/lib/src/build/script_compactor.dart

Issue 53253004: fix warning in polymer script_compactor (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /** Transfomer that combines multiple dart script tags into a single one. */ 5 /** Transfomer that combines multiple dart script tags into a single one. */
6 library polymer.src.build.script_compactor; 6 library polymer.src.build.script_compactor;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:convert'; 9 import 'dart:convert';
10 10
(...skipping 24 matching lines...) Expand all
35 /** Only run on entry point .html files. */ 35 /** Only run on entry point .html files. */
36 Future<bool> isPrimary(Asset input) => 36 Future<bool> isPrimary(Asset input) =>
37 new Future.value(options.isHtmlEntryPoint(input.id)); 37 new Future.value(options.isHtmlEntryPoint(input.id));
38 38
39 Future apply(Transform transform) { 39 Future apply(Transform transform) {
40 var id = transform.primaryInput.id; 40 var id = transform.primaryInput.id;
41 var secondaryId = id.addExtension('.scriptUrls'); 41 var secondaryId = id.addExtension('.scriptUrls');
42 var logger = transform.logger; 42 var logger = transform.logger;
43 return readPrimaryAsHtml(transform).then((document) { 43 return readPrimaryAsHtml(transform).then((document) {
44 return transform.readInputAsString(secondaryId).then((libraryIds) { 44 return transform.readInputAsString(secondaryId).then((libraryIds) {
45 var libraries = JSON.decode(libraryIds).map( 45 var libraries = (JSON.decode(libraryIds) as Iterable).map(
46 (data) => new AssetId.deserialize(data)).toList(); 46 (data) => new AssetId.deserialize(data)).toList();
47 var mainLibraryId; 47 var mainLibraryId;
48 var mainScriptTag; 48 var mainScriptTag;
49 bool changed = false; 49 bool changed = false;
50 50
51 for (var tag in document.queryAll('script')) { 51 for (var tag in document.queryAll('script')) {
52 var src = tag.attributes['src']; 52 var src = tag.attributes['src'];
53 if (src == 'packages/polymer/boot.js') { 53 if (src == 'packages/polymer/boot.js') {
54 tag.remove(); 54 tag.remove();
55 continue; 55 continue;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 }); 112 });
113 }); 113 });
114 } 114 }
115 } 115 }
116 116
117 const MAIN_HEADER = """ 117 const MAIN_HEADER = """
118 library app_bootstrap; 118 library app_bootstrap;
119 119
120 import 'package:polymer/polymer.dart'; 120 import 'package:polymer/polymer.dart';
121 """; 121 """;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698