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

Unified Diff: pkg/polymer/lib/src/build/polyfill_injector.dart

Issue 558673004: update polymer js to 0.4.0 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: review updates 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 | « pkg/polymer/example/component/news/test/news_index_test.html ('k') | pkg/polymer/lib/src/declaration.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/build/polyfill_injector.dart
diff --git a/pkg/polymer/lib/src/build/polyfill_injector.dart b/pkg/polymer/lib/src/build/polyfill_injector.dart
index 1b8872835956e18252aaa7aa245b9b7a4cbe8e1d..e416352be8fae90ae9c9bbff631c48756d31e588 100644
--- a/pkg/polymer/lib/src/build/polyfill_injector.dart
+++ b/pkg/polymer/lib/src/build/polyfill_injector.dart
@@ -37,7 +37,8 @@ class PolyfillInjector extends Transformer with PolymerTransformer {
convertErrorsToWarnings: !options.releaseMode,
detailsUri: 'http://goo.gl/5HPeuP');
return readPrimaryAsHtml(transform, logger).then((document) {
- bool webComponentsFound = false;
+ bool dartSupportFound = false;
+ bool platformJsFound = false;
Element dartJs;
final dartScripts = <Element>[];
@@ -45,8 +46,10 @@ class PolyfillInjector extends Transformer with PolymerTransformer {
var src = tag.attributes['src'];
if (src != null) {
var last = src.split('/').last;
- if (_webComponentsJS.hasMatch(last)) {
- webComponentsFound = true;
+ if (_platformJS.hasMatch(last)) {
+ platformJsFound = true;
+ } else if (_dartSupportJS.hasMatch(last)) {
+ dartSupportFound = true;
} else if (last == 'dart.js') {
dartJs = tag;
}
@@ -95,12 +98,9 @@ class PolyfillInjector extends Transformer with PolymerTransformer {
}
var suffix = options.releaseMode ? '.js' : '.concat.js';
- if (!webComponentsFound) {
- _addScriptFirst('web_components/dart_support.js');
-
- // platform.js should come before all other scripts.
- _addScriptFirst('web_components/platform$suffix');
- }
+ if (!dartSupportFound) _addScriptFirst('web_components/dart_support.js');
+ // platform.js should come before all other scripts.
+ if (!platformJsFound) _addScriptFirst('web_components/platform$suffix');
transform.addOutput(
new Asset.fromString(transform.primaryInput.id, document.outerHtml));
@@ -108,5 +108,5 @@ class PolyfillInjector extends Transformer with PolymerTransformer {
}
}
-final _webComponentsJS = new RegExp(r'platform.*\.js',
- caseSensitive: false);
+final _platformJS = new RegExp(r'platform.*\.js', caseSensitive: false);
+final _dartSupportJS = new RegExp(r'dart_support.js', caseSensitive: false);
« no previous file with comments | « pkg/polymer/example/component/news/test/news_index_test.html ('k') | pkg/polymer/lib/src/declaration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698