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

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

Issue 23678009: fixed TodoMVC tests to include deploying to JS (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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/lib/deploy.dart ('k') | pkg/polymer/test/transform/all_phases_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/transform/polyfill_injector.dart
diff --git a/pkg/polymer/lib/src/transform/polyfill_injector.dart b/pkg/polymer/lib/src/transform/polyfill_injector.dart
index d722d1be6ae37657c063506e4b69c3721bbe370d..6b951139fb5cfa7a787f6c7ddf07f40aa965ee01 100644
--- a/pkg/polymer/lib/src/transform/polyfill_injector.dart
+++ b/pkg/polymer/lib/src/transform/polyfill_injector.dart
@@ -30,6 +30,7 @@ class PolyfillInjector extends Transformer {
return readPrimaryAsHtml(transform).then((document) {
bool shadowDomFound = false;
bool jsInteropFound = false;
+ bool pkgJsInteropFound = false;
bool dartScriptTags = false;
for (var tag in document.queryAll('script')) {
@@ -38,6 +39,8 @@ class PolyfillInjector extends Transformer {
var last = src.split('/').last;
if (last == 'interop.js') {
jsInteropFound = true;
+ } else if (last == 'dart_interop.js') {
+ pkgJsInteropFound = true;
} else if (_shadowDomJS.hasMatch(last)) {
shadowDomFound = true;
}
@@ -54,6 +57,12 @@ class PolyfillInjector extends Transformer {
return;
}
+ if (!pkgJsInteropFound) {
+ // JS interop code is required for Polymer CSS shimming.
+ document.body.nodes.insert(0, parseFragment(
+ '<script src="packages/js/dart_interop.js"></script>\n'));
+ }
+
if (!jsInteropFound) {
// JS interop code is required for Polymer CSS shimming.
document.body.nodes.insert(0, parseFragment(
@@ -63,8 +72,9 @@ class PolyfillInjector extends Transformer {
if (!shadowDomFound) {
// Insert at the beginning (this polyfill needs to run as early as
// possible).
+ // TODO(jmesserly): this is .debug to workaround issue 13046.
document.body.nodes.insert(0, parseFragment(
- '<script src="packages/shadow_dom/shadow_dom.min.js"></script>\n'));
+ '<script src="packages/shadow_dom/shadow_dom.debug.js"></script>\n'));
}
transform.addOutput(
« no previous file with comments | « pkg/polymer/lib/deploy.dart ('k') | pkg/polymer/test/transform/all_phases_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698