Chromium Code Reviews| Index: pkg/polymer/lib/src/build/import_inliner.dart |
| diff --git a/pkg/polymer/lib/src/build/import_inliner.dart b/pkg/polymer/lib/src/build/import_inliner.dart |
| index cf3b7d931e3c6ad44e52c0f90bc95b0d30f83bb2..8b8887d3fe40c2d1f2fbdfacbff62f1cda9accf3 100644 |
| --- a/pkg/polymer/lib/src/build/import_inliner.dart |
| +++ b/pkg/polymer/lib/src/build/import_inliner.dart |
| @@ -30,7 +30,7 @@ class _HtmlInliner extends PolymerTransformer { |
| final BuildLogger logger; |
| final AssetId docId; |
| final seen = new Set<AssetId>(); |
| - final scriptIds = <AssetId>[]; |
| + final scriptIds = new List<AssetId>(); |
|
Siggi Cherem (dart-lang)
2014/10/21 17:06:03
undo?
jakemac
2014/10/21 18:14:01
Done.
|
| final inlinedStylesheetIds = new Set<AssetId>(); |
| final extractedFiles = new Set<AssetId>(); |
| bool experimentalBootstrap = false; |
| @@ -241,6 +241,13 @@ class _HtmlInliner extends PolymerTransformer { |
| var src = script.attributes['src']; |
| var srcId = uriToAssetId(docId, src, logger, script.sourceSpan); |
| + // No duplicates allowed! |
| + if (scriptIds.contains(srcId)) { |
|
Siggi Cherem (dart-lang)
2014/10/21 17:06:03
might be worth to keep a set on the side here - to
jakemac
2014/10/21 18:14:01
Done.
|
| + logger.warning(SCRIPT_INCLUDED_MORE_THAN_ONCE.create({'url': src}), |
| + span: script.sourceSpan); |
| + return true; |
| + } |
| + |
| // We check for extractedFiles because 'hasInput' below is only true for |
| // assets that existed before this transformer runs (hasInput is false |
| // for files created by [_extractScripts]). |