OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of polymer; | 5 part of polymer; |
6 | 6 |
7 /** Annotation used to automatically register polymer elements. */ | 7 /** Annotation used to automatically register polymer elements. */ |
8 class CustomTag { | 8 class CustomTag { |
9 final String tagName; | 9 final String tagName; |
10 const CustomTag(this.tagName); | 10 const CustomTag(this.tagName); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 if (seen == null) seen = new Set<Document>(); | 120 if (seen == null) seen = new Set<Document>(); |
121 if (scripts == null) scripts = <String>[]; | 121 if (scripts == null) scripts = <String>[]; |
122 if (doc == null) { | 122 if (doc == null) { |
123 print('warning: $baseUri not found.'); | 123 print('warning: $baseUri not found.'); |
124 return scripts; | 124 return scripts; |
125 } | 125 } |
126 if (seen.contains(doc)) return scripts; | 126 if (seen.contains(doc)) return scripts; |
127 seen.add(doc); | 127 seen.add(doc); |
128 | 128 |
129 bool scriptSeen = false; | 129 bool scriptSeen = false; |
130 for (var node in doc.queryAll('script,link[rel="import"]')) { | 130 for (var node in doc.querySelectorAll('script,link[rel="import"]')) { |
131 if (node is LinkElement) { | 131 if (node is LinkElement) { |
132 _discoverScripts(node.import, node.href, seen, scripts); | 132 _discoverScripts(node.import, node.href, seen, scripts); |
133 } else if (node is ScriptElement && node.type == 'application/dart') { | 133 } else if (node is ScriptElement && node.type == 'application/dart') { |
134 if (!scriptSeen) { | 134 if (!scriptSeen) { |
135 var url = node.src; | 135 var url = node.src; |
136 scripts.add(url == '' ? baseUri : url); | 136 scripts.add(url == '' ? baseUri : url); |
137 scriptSeen = true; | 137 scriptSeen = true; |
138 } else { | 138 } else { |
139 print('warning: more than one Dart script tag in $baseUri. Dartium ' | 139 print('warning: more than one Dart script tag in $baseUri. Dartium ' |
140 'currently only allows a single Dart script tag per document.'); | 140 'currently only allows a single Dart script tag per document.'); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 print("warning: methods marked with @initMethod should take no " | 238 print("warning: methods marked with @initMethod should take no " |
239 "arguments, ${method.simpleName} expects some."); | 239 "arguments, ${method.simpleName} expects some."); |
240 return; | 240 return; |
241 } | 241 } |
242 initializers.add(() => obj.invoke(method.simpleName, const [])); | 242 initializers.add(() => obj.invoke(method.simpleName, const [])); |
243 } | 243 } |
244 | 244 |
245 class _InitMethodAnnotation { | 245 class _InitMethodAnnotation { |
246 const _InitMethodAnnotation(); | 246 const _InitMethodAnnotation(); |
247 } | 247 } |
OLD | NEW |