OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 /** | 5 /** |
6 * A script to assist in documenting the difference between the dart:html API | 6 * A script to assist in documenting the difference between the dart:html API |
7 * and the old DOM API. | 7 * and the old DOM API. |
8 */ | 8 */ |
9 #library('html_diff'); | 9 #library('html_diff'); |
10 | 10 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 if (htmlType == null) return null; | 161 if (htmlType == null) return null; |
162 | 162 |
163 bool getter, setter; | 163 bool getter, setter; |
164 if (implMember.isConstructor || implMember.isFactory) { | 164 if (implMember.isConstructor || implMember.isFactory) { |
165 var constructor = htmlType.constructors[implMember.name]; | 165 var constructor = htmlType.constructors[implMember.name]; |
166 if (constructor != null) return constructor; | 166 if (constructor != null) return constructor; |
167 return htmlType.factories[implMember.name]; | 167 return htmlType.factories[implMember.name]; |
168 } else if ((getter = implMember.name.startsWith('get:')) || | 168 } else if ((getter = implMember.name.startsWith('get:')) || |
169 (setter = implMember.name.startsWith('set:'))) { | 169 (setter = implMember.name.startsWith('set:'))) { |
170 // Use getMember to follow interface inheritance chains. If it's a | 170 // Use getMember to follow interface inheritance chains. If it's a |
171 // ConcreteMember, though, it's an implementation of some data structure | 171 // Member, though, it's an implementation of some data structure |
172 // and we don't care about it. | 172 // and we don't care about it. |
173 var htmlProperty = htmlType.getMember(implMember.name.substring(4)); | 173 var htmlProperty = htmlType.getMember(implMember.name.substring(4)); |
174 if (htmlProperty != null && htmlProperty is! ConcreteMember) { | 174 if (htmlProperty != null && htmlProperty is! Member) { |
175 return getter ? htmlProperty.getter : htmlProperty.setter; | 175 return getter ? htmlProperty.getter : htmlProperty.setter; |
176 } else { | 176 } else { |
177 return null; | 177 return null; |
178 } | 178 } |
179 } else { | 179 } else { |
180 return htmlType.getMember(implMember.name); | 180 return htmlType.getMember(implMember.name); |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 /** | 184 /** |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 Map<String, String> _getTags(String comment) { | 393 Map<String, String> _getTags(String comment) { |
394 if (comment == null) return const <String>{}; | 394 if (comment == null) return const <String>{}; |
395 final re = new RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"); | 395 final re = new RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"); |
396 final tags = <String>{}; | 396 final tags = <String>{}; |
397 for (var m in re.allMatches(comment.trim())) { | 397 for (var m in re.allMatches(comment.trim())) { |
398 tags[m[1]] = m[2]; | 398 tags[m[1]] = m[2]; |
399 } | 399 } |
400 return tags; | 400 return tags; |
401 } | 401 } |
402 } | 402 } |
OLD | NEW |