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

Unified Diff: pkg/polymer/lib/boot.js

Issue 26636002: Show error message if dart.js is also together with boot.js on the page. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/boot.js
diff --git a/pkg/polymer/lib/boot.js b/pkg/polymer/lib/boot.js
index 2bcb5902bd085fb5cd76725f2780d10b71b63439..9b1eef8a94c768e9dda7557d235457a5b3b0c6ff 100644
--- a/pkg/polymer/lib/boot.js
+++ b/pkg/polymer/lib/boot.js
@@ -57,6 +57,16 @@
return;
}
+ // Detect if dart.js was included in the page. We use DOMContentLoaded to make
+ // sure we also check for occurrences after the current tag.
+ window.addEventListener('DOMContentLoaded', function () {
+ var dartJSQuery = 'script[src="packages/browser/dart.js"]';
+ if (!!document.querySelector(dartJSQuery)) {
+ console.error('Error: found "packages/browser/dart.js" in the ' +
+ 'page. Please remove it. When using polymer\'s "boot.js", ' +
+ 'you can\'t use "dart.js".');
+ }
+ });
// Load HTML Imports:
var htmlImportsSrc = 'src="packages/html_import/html_import.min.js"';
« 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