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

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

Issue 191423002: [polymer] remove bogus warning about JS inline scripts (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/build/linter.dart
diff --git a/pkg/polymer/lib/src/build/linter.dart b/pkg/polymer/lib/src/build/linter.dart
index 06004eb4bb713f038cc2572aaa1d6ad78a20cb1e..acd9c63a2d518312cbfe44168546755e2e98153b 100644
--- a/pkg/polymer/lib/src/build/linter.dart
+++ b/pkg/polymer/lib/src/build/linter.dart
@@ -244,31 +244,13 @@ class _LinterVisitor extends TreeVisitor {
_inPolymerElement = oldValue;
}
- /// Produces warnings for malformed script tags. In html5 leaving off type= is
- /// fine, but it defaults to text/javascript. Because this might be a common
- /// error, we warn about it when src file ends in .dart, but the type is
- /// incorrect, or when users write code in an inline script tag of a custom
- /// element.
- ///
- /// The hope is that these cases shouldn't break existing valid code, but that
- /// they'll help Polymer authors avoid having their Dart code accidentally
- /// interpreted as JavaScript by the browser.
+ /// Checks for multiple Dart script tags in the same page, which is invalid.
void _validateScriptElement(Element node) {
var scriptType = node.attributes['type'];
var isDart = scriptType == 'application/dart';
var src = node.attributes['src'];
- if (scriptType == null) {
- if (src == null && _inPolymerElement) {
- // TODO(sigmund): revisit this check once we start interop with polymer
- // elements written in JS. Maybe we need to inspect the contents of the
- // script to find whether there is an import or something that indicates
- // that the code is indeed using Dart.
- _logger.warning('script tag in polymer element with no type will '
- 'be treated as JavaScript. Did you forget type="application/dart"?',
- span: node.sourceSpan);
- }
- } else if (isDart) {
+ if (isDart) {
if (_dartTagSeen) {
_logger.warning('Only one "application/dart" script tag per document '
'is allowed.', span: node.sourceSpan);
« no previous file with comments | « no previous file | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698