OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 } | 110 } |
111 | 111 |
112 /** | 112 /** |
113 * Computes the `dart:dom_deprecated` to `dart:html` mapping, and | 113 * Computes the `dart:dom_deprecated` to `dart:html` mapping, and |
114 * places it in [domToHtml], [htmlToDom], [domTypesToHtml], and | 114 * places it in [domToHtml], [htmlToDom], [domTypesToHtml], and |
115 * [htmlTypesToDom]. Before this is run, Frog should be initialized | 115 * [htmlTypesToDom]. Before this is run, Frog should be initialized |
116 * (via [parseOptions] and [initializeWorld]) and | 116 * (via [parseOptions] and [initializeWorld]) and |
117 * [HtmlDiff.initialize] should be called. | 117 * [HtmlDiff.initialize] should be called. |
118 */ | 118 */ |
119 void run() { | 119 void run() { |
120 print("libraries: "); | |
121 for(var e in _mirrors.libraries().getKeys()) { print("Lib: $e"); } | |
Bob Nystrom
2012/08/08 17:32:24
Debug code?
| |
120 LibraryMirror htmlLib = findMirror(_mirrors.libraries(), HTML_LIBRARY_NAME); | 122 LibraryMirror htmlLib = findMirror(_mirrors.libraries(), HTML_LIBRARY_NAME); |
121 if (htmlLib === null) { | 123 if (htmlLib === null) { |
122 warn('Could not find $HTML_LIBRARY_NAME'); | 124 warn('Could not find $HTML_LIBRARY_NAME'); |
123 return; | 125 return; |
124 } | 126 } |
125 for (InterfaceMirror htmlType in htmlLib.types().getValues()) { | 127 for (InterfaceMirror htmlType in htmlLib.types().getValues()) { |
126 final domTypes = htmlToDomTypes(htmlType); | 128 final domTypes = htmlToDomTypes(htmlType); |
127 if (domTypes.isEmpty()) continue; | 129 if (domTypes.isEmpty()) continue; |
128 | 130 |
129 htmlTypesToDom.putIfAbsent(htmlType.qualifiedName(), | 131 htmlTypesToDom.putIfAbsent(htmlType.qualifiedName(), |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
281 Map<String, String> _getTags(String comment) { | 283 Map<String, String> _getTags(String comment) { |
282 if (comment == null) return const <String>{}; | 284 if (comment == null) return const <String>{}; |
283 final re = const RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"); | 285 final re = const RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"); |
284 final tags = <String>{}; | 286 final tags = <String>{}; |
285 for (var m in re.allMatches(comment.trim())) { | 287 for (var m in re.allMatches(comment.trim())) { |
286 tags[m[1]] = m[2]; | 288 tags[m[1]] = m[2]; |
287 } | 289 } |
288 return tags; | 290 return tags; |
289 } | 291 } |
290 } | 292 } |
OLD | NEW |