Chromium Code Reviews| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 | 91 |
| 92 /** | 92 /** |
| 93 * Computes the `@domName` to `dart:html` mapping, and | 93 * Computes the `@domName` to `dart:html` mapping, and |
| 94 * places it in [htmlToDom] and [htmlTypesToDom]. Before this is run, dart2js | 94 * places it in [htmlToDom] and [htmlTypesToDom]. Before this is run, dart2js |
| 95 * should be initialized (via [parseOptions] and [initializeWorld]) and | 95 * should be initialized (via [parseOptions] and [initializeWorld]) and |
| 96 * [HtmlDiff.initialize] should be called. | 96 * [HtmlDiff.initialize] should be called. |
| 97 */ | 97 */ |
| 98 void run() { | 98 void run() { |
| 99 LibraryMirror htmlLib = _mirrors.libraries[HTML_DECLARED_NAME]; | 99 LibraryMirror htmlLib = _mirrors.libraries[HTML_DECLARED_NAME]; |
| 100 if (htmlLib === null) { | 100 if (htmlLib === null) { |
| 101 print('NOOOO'); | |
|
Bob Nystrom
2012/10/24 20:52:15
Debug code. Remove. :)
Andrei Mouravski
2012/10/24 21:19:36
NOOOOOOOOOO!
Done.
| |
| 101 warn('Could not find $HTML_LIBRARY_NAME'); | 102 warn('Could not find $HTML_LIBRARY_NAME'); |
| 102 return; | 103 return; |
| 103 } | 104 } |
| 104 for (InterfaceMirror htmlType in htmlLib.types.getValues()) { | 105 for (InterfaceMirror htmlType in htmlLib.types.getValues()) { |
| 105 final domTypes = htmlToDomTypes(htmlType); | 106 final domTypes = htmlToDomTypes(htmlType); |
| 106 if (domTypes.isEmpty) continue; | 107 if (domTypes.isEmpty) continue; |
| 107 | 108 |
| 108 htmlTypesToDom.putIfAbsent(htmlType.qualifiedName, | 109 htmlTypesToDom.putIfAbsent(htmlType.qualifiedName, |
| 109 () => new Set()).addAll(domTypes); | 110 () => new Set()).addAll(domTypes); |
| 110 | 111 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 Map<String, String> _getTags(String comment) { | 230 Map<String, String> _getTags(String comment) { |
| 230 if (comment == null) return const <String, String>{}; | 231 if (comment == null) return const <String, String>{}; |
| 231 final re = const RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"); | 232 final re = const RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"); |
| 232 final tags = <String, String>{}; | 233 final tags = <String, String>{}; |
| 233 for (var m in re.allMatches(comment.trim())) { | 234 for (var m in re.allMatches(comment.trim())) { |
| 234 tags[m[1]] = m[2]; | 235 tags[m[1]] = m[2]; |
| 235 } | 236 } |
| 236 return tags; | 237 return tags; |
| 237 } | 238 } |
| 238 } | 239 } |
| OLD | NEW |